summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-09-13 19:45:36 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-09-13 19:45:36 +0000
commit3baada38f8047e7821979b961a07e02659cedf99 (patch)
tree0953bdd2fc087b841ae4f5b5d6720d57cd965118 /lisp/diff-mode.el
parent8b6c1445c268de4c7b8a8ab6d10b560af230370c (diff)
downloademacs-3baada38f8047e7821979b961a07e02659cedf99.tar.gz
(diff-mode): Turn on compilation-minor-mode
support again, but more carefully this time.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index ce0a7bb4fb1..b04719298a8 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -878,16 +878,19 @@ a diff with \\[diff-reverse-direction]."
;; (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))