changeset 47476:68e034e01f4c

(diff-mode): Turn on compilation-minor-mode support again, but more carefully this time.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 13 Sep 2002 19:45:36 +0000
parents ee41d5989edf
children dec829d59f3c
files lisp/diff-mode.el
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/diff-mode.el	Fri Sep 13 19:36:55 2002 +0000
+++ b/lisp/diff-mode.el	Fri Sep 13 19:45:36 2002 +0000
@@ -878,16 +878,19 @@
   ;;   (set (make-local-variable 'page-delimiter) "--- [^\t]+\t")
   ;; compile support
 
-  ;;;; compile support is not good enough yet.  Also it can be annoying
-  ;; and should thus only be enabled conditionally.
-  ;; (set (make-local-variable 'compilation-file-regexp-alist)
-  ;;      diff-file-regexp-alist)
-  ;; (set (make-local-variable 'compilation-error-regexp-alist)
-  ;;      diff-error-regexp-alist)
-  ;; (when (string-match "\\.rej\\'" (or buffer-file-name ""))
-  ;;   (set (make-local-variable 'compilation-current-file)
-  ;; 	 (substring buffer-file-name 0 (match-beginning 0))))
-  ;; (compilation-shell-minor-mode 1)
+  ;;;; compile support is not good enough yet.  It should be merged
+  ;;;; with diff.el's support.
+  (set (make-local-variable 'compilation-file-regexp-alist)
+       diff-file-regexp-alist)
+  (set (make-local-variable 'compilation-error-regexp-alist)
+       diff-error-regexp-alist)
+  (when (string-match "\\.rej\\'" (or buffer-file-name ""))
+    (set (make-local-variable 'compilation-current-file)
+  	 (substring buffer-file-name 0 (match-beginning 0))))
+  ;; Be careful not to change compilation-last-buffer when we're just
+  ;; doing a C-x v = (for example).
+  (let ((compilation-last-buffer compilation-last-buffer))
+    (compilation-shell-minor-mode 1))
 
   (when (and (> (point-max) (point-min)) diff-default-read-only)
     (toggle-read-only t))