]> code.delx.au - gnu-emacs/blobdiff - lisp/diff.el
Comment change.
[gnu-emacs] / lisp / diff.el
index 3d05a3bda74f7e6449dc792598a03b89b67db295..fb1793e627b043c4326c3751d9c64fe322d0aaae 100644 (file)
@@ -1,7 +1,8 @@
-;;; diff.el --- Run `diff' in compilation-mode.
+;;; diff.el --- run `diff' in compilation-mode
 
-;; Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994, 1996, 2001 Free Software Foundation, Inc.
 
+;; Maintainer: FSF
 ;; Keywords: unix, tools
 
 ;; This file is part of GNU Emacs.
 
 (require 'compile)
 
-;;; This is duplicated in vc.el.
-(defvar diff-switches "-c"
-  "*A string or list of strings specifying switches to be be passed to diff.")
+(defgroup diff nil
+  "Comparing files with `diff'."
+  :group 'tools)
 
-(defvar diff-command "diff"
-  "*The command to use to run diff.")
+;;;###autoload
+(defcustom diff-switches "-c"
+  "*A string or list of strings specifying switches to be be passed to diff."
+  :type '(choice string (repeat string))
+  :group 'diff)
+
+;;;###autoload
+(defcustom diff-command "diff"
+  "*The command to use to run diff."
+  :type 'string
+  :group 'diff)
 
 (defvar diff-regexp-alist
   '(
@@ -152,11 +162,11 @@ is nil, REGEXP matches only half a section.")
              ;; We have found as many new loci as the user wants,
              ;; or the user wanted a specific diff, and we're past it.
          (setq found-desired t)))
-    (if found-desired
-       (setq compilation-parsing-end (point))
-      ;; Set to point-max, not point, so we don't perpetually
-      ;; parse the last bit of text when it isn't a diff header.
-      (setq compilation-parsing-end (point-max)))
+    (set-marker compilation-parsing-end
+               (if found-desired (point)
+                 ;; Set to point-max, not point, so we don't perpetually
+                 ;; parse the last bit of text when it isn't a diff header.
+                 (point-max)))
     (message "Parsing differences...done"))
   (setq compilation-error-list (nreverse compilation-error-list)))
 
@@ -189,14 +199,14 @@ With prefix arg, prompt for diff switches."
        (setq newf (buffer-file-name)
              newf (if (and newf (file-exists-p newf))
                       (read-file-name
-                       (concat "Diff new file: ("
+                       (concat "Diff new file: (default "
                                (file-name-nondirectory newf) ") ")
                        nil newf t)
                     (read-file-name "Diff new file: " nil nil t)))
        (setq oldf (file-newest-backup newf)
              oldf (if (and oldf (file-exists-p oldf))
                       (read-file-name
-                       (concat "Diff original file: ("
+                       (concat "Diff original file: (default "
                                (file-name-nondirectory oldf) ") ")
                        (file-name-directory oldf) oldf t)
                     (read-file-name "Diff original file: "