aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/diff-mode.el40
1 files changed, 4 insertions, 36 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index e44e79856e8..14be2e841a3 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -1,6 +1,6 @@
1;;; diff-mode.el --- a mode for viewing/editing context diffs 1;;; diff-mode.el --- a mode for viewing/editing context diffs
2 2
3;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1998,1999,2000,01,02,03,2004 Free Software Foundation, Inc.
4 4
5;; Author: Stefan Monnier <monnier@cs.yale.edu> 5;; Author: Stefan Monnier <monnier@cs.yale.edu>
6;; Keywords: convenience patch diff 6;; Keywords: convenience patch diff
@@ -28,7 +28,7 @@
28;; commands, editing and various conversions as well as jumping 28;; commands, editing and various conversions as well as jumping
29;; to the corresponding source file. 29;; to the corresponding source file.
30 30
31;; Inspired by Pavel Machek's patch-mode.el (<pavel@atrey.karlin.mff.cuni.cz>) 31;; Inspired by Pavel Machek's patch-mode.el (<pavel@@atrey.karlin.mff.cuni.cz>)
32;; Some efforts were spent to have it somewhat compatible with XEmacs' 32;; Some efforts were spent to have it somewhat compatible with XEmacs'
33;; diff-mode as well as with compilation-minor-mode 33;; diff-mode as well as with compilation-minor-mode
34 34
@@ -272,18 +272,6 @@ when editing big diffs)."
272 (nil "^--- \\([^\t\n]+\\)\t.*\n\\*" 1))) ; context diffs 272 (nil "^--- \\([^\t\n]+\\)\t.*\n\\*" 1))) ; context diffs
273 273
274;;;; 274;;;;
275;;;; Compile support
276;;;;
277
278(defvar diff-file-regexp-alist
279 '(("Index: \\(.+\\)" 1)))
280
281(defvar diff-error-regexp-alist
282 '(("@@ -\\([0-9]+\\),[0-9]+ \\+\\([0-9]+\\),[0-9]+ @@" nil 2)
283 ("--- \\([0-9]+\\),[0-9]+ ----" nil 1)
284 ("\\([0-9]+\\)\\(,[0-9]+\\)?[adc]\\([0-9]+\\)" nil 3)))
285
286;;;;
287;;;; Movement 275;;;; Movement
288;;;; 276;;;;
289 277
@@ -879,31 +867,11 @@ a diff with \\[diff-reverse-direction]."
879 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t") 867 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t")
880 ;; compile support 868 ;; compile support
881 869
882 ;;;; compile support is not good enough yet. It should be merged
883 ;;;; with diff.el's support.
884 (set (make-local-variable 'compilation-file-regexp-alist)
885 diff-file-regexp-alist)
886 (set (make-local-variable 'compilation-error-regexp-alist)
887 diff-error-regexp-alist)
888 (when (string-match "\\.rej\\'" (or buffer-file-name ""))
889 (set (make-local-variable 'compilation-current-file)
890 (substring buffer-file-name 0 (match-beginning 0))))
891 ;; Be careful not to change compilation-last-buffer when we're just
892 ;; doing a C-x v = (for example).
893 (if (boundp 'compilation-last-buffer)
894 (let ((compilation-last-buffer compilation-last-buffer))
895 (compilation-minor-mode 1))
896 (compilation-minor-mode 1))
897 ;; M-RET and RET should be done by diff-mode because the `compile'
898 ;; support is significantly less good.
899 (add-to-list 'minor-mode-overriding-map-alist
900 (cons 'compilation-minor-mode (make-sparse-keymap)))
901
902 (when (and (> (point-max) (point-min)) diff-default-read-only) 870 (when (and (> (point-max) (point-min)) diff-default-read-only)
903 (toggle-read-only t)) 871 (toggle-read-only t))
904 ;; setup change hooks 872 ;; setup change hooks
905 (if (not diff-update-on-the-fly) 873 (if (not diff-update-on-the-fly)
906 (add-hook 'write-contents-hooks 'diff-write-contents-hooks) 874 (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t)
907 (make-local-variable 'diff-unhandled-changes) 875 (make-local-variable 'diff-unhandled-changes)
908 (add-hook 'after-change-functions 'diff-after-change-function nil t) 876 (add-hook 'after-change-functions 'diff-after-change-function nil t)
909 (add-hook 'post-command-hook 'diff-post-command-hook nil t)) 877 (add-hook 'post-command-hook 'diff-post-command-hook nil t))
@@ -924,7 +892,7 @@ a diff with \\[diff-reverse-direction]."
924 ;; FIXME: setup font-lock 892 ;; FIXME: setup font-lock
925 ;; setup change hooks 893 ;; setup change hooks
926 (if (not diff-update-on-the-fly) 894 (if (not diff-update-on-the-fly)
927 (add-hook 'write-contents-hooks 'diff-write-contents-hooks) 895 (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t)
928 (make-local-variable 'diff-unhandled-changes) 896 (make-local-variable 'diff-unhandled-changes)
929 (add-hook 'after-change-functions 'diff-after-change-function nil t) 897 (add-hook 'after-change-functions 'diff-after-change-function nil t)
930 (add-hook 'post-command-hook 'diff-post-command-hook nil t))) 898 (add-hook 'post-command-hook 'diff-post-command-hook nil t)))