summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-09-18 12:09:07 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-09-18 12:09:07 +0000
commitadf8363c7d90de2506350cd0dd7128228a4d0c00 (patch)
tree3ca2f83bec64c9963bb6f3845cbd08f89f53cbf8 /lisp/diff-mode.el
parentd7221af8213c3217e5035e5817e5715e6c2b0ba8 (diff)
downloademacs-adf8363c7d90de2506350cd0dd7128228a4d0c00.tar.gz
(diff-mode): Use compilation-minor-mode.
Don't unbind compilation-last-buffer after autoload compile.el. Hide the compilation-minor-mode bindings altogether.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 94ce53c1040..7899da63eed 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -889,10 +889,14 @@ a diff with \\[diff-reverse-direction]."
(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
- (and (boundp 'compilation-last-buffer)
- compilation-last-buffer)))
- (compilation-shell-minor-mode 1))
+ (if (boundp 'compilation-last-buffer)
+ (let ((compilation-last-buffer compilation-last-buffer))
+ (compilation-minor-mode 1))
+ (compilation-minor-mode 1))
+ ;; M-RET and RET should be done by diff-mode because the `compile'
+ ;; support is significantly less good.
+ (add-to-list 'minor-mode-overriding-map-alist
+ (cons 'compilation-minor-mode (make-sparse-keymap)))
(when (and (> (point-max) (point-min)) diff-default-read-only)
(toggle-read-only t))
@@ -903,7 +907,7 @@ a diff with \\[diff-reverse-direction]."
(add-hook 'after-change-functions 'diff-after-change-function nil t)
(add-hook 'post-command-hook 'diff-post-command-hook nil t))
;; Neat trick from Dave Love to add more bindings in read-only mode:
- (add-to-list (make-local-variable 'minor-mode-overriding-map-alist)
+ (add-to-list 'minor-mode-overriding-map-alist
(cons 'buffer-read-only diff-mode-shared-map))
;; add-log support
(set (make-local-variable 'add-log-current-defun-function)