aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-09-18 12:09:07 +0000
committerStefan Monnier2002-09-18 12:09:07 +0000
commitadf8363c7d90de2506350cd0dd7128228a4d0c00 (patch)
tree3ca2f83bec64c9963bb6f3845cbd08f89f53cbf8
parentd7221af8213c3217e5035e5817e5715e6c2b0ba8 (diff)
downloademacs-adf8363c7d90de2506350cd0dd7128228a4d0c00.tar.gz
emacs-adf8363c7d90de2506350cd0dd7128228a4d0c00.zip
(diff-mode): Use compilation-minor-mode.
Don't unbind compilation-last-buffer after autoload compile.el. Hide the compilation-minor-mode bindings altogether.
-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]."
889 (substring buffer-file-name 0 (match-beginning 0)))) 889 (substring buffer-file-name 0 (match-beginning 0))))
890 ;; Be careful not to change compilation-last-buffer when we're just 890 ;; Be careful not to change compilation-last-buffer when we're just
891 ;; doing a C-x v = (for example). 891 ;; doing a C-x v = (for example).
892 (let ((compilation-last-buffer 892 (if (boundp 'compilation-last-buffer)
893 (and (boundp 'compilation-last-buffer) 893 (let ((compilation-last-buffer compilation-last-buffer))
894 compilation-last-buffer))) 894 (compilation-minor-mode 1))
895 (compilation-shell-minor-mode 1)) 895 (compilation-minor-mode 1))
896 ;; M-RET and RET should be done by diff-mode because the `compile'
897 ;; support is significantly less good.
898 (add-to-list 'minor-mode-overriding-map-alist
899 (cons 'compilation-minor-mode (make-sparse-keymap)))
896 900
897 (when (and (> (point-max) (point-min)) diff-default-read-only) 901 (when (and (> (point-max) (point-min)) diff-default-read-only)
898 (toggle-read-only t)) 902 (toggle-read-only t))
@@ -903,7 +907,7 @@ a diff with \\[diff-reverse-direction]."
903 (add-hook 'after-change-functions 'diff-after-change-function nil t) 907 (add-hook 'after-change-functions 'diff-after-change-function nil t)
904 (add-hook 'post-command-hook 'diff-post-command-hook nil t)) 908 (add-hook 'post-command-hook 'diff-post-command-hook nil t))
905 ;; Neat trick from Dave Love to add more bindings in read-only mode: 909 ;; Neat trick from Dave Love to add more bindings in read-only mode:
906 (add-to-list (make-local-variable 'minor-mode-overriding-map-alist) 910 (add-to-list 'minor-mode-overriding-map-alist
907 (cons 'buffer-read-only diff-mode-shared-map)) 911 (cons 'buffer-read-only diff-mode-shared-map))
908 ;; add-log support 912 ;; add-log support
909 (set (make-local-variable 'add-log-current-defun-function) 913 (set (make-local-variable 'add-log-current-defun-function)