]> code.delx.au - gnu-emacs/blobdiff - lisp/diff-mode.el
(customize-changed-options): Doc addition. Load the
[gnu-emacs] / lisp / diff-mode.el
index b04719298a8209cbcb00dbd4fc268dcceb7a0cde..7899da63eed9a93091b86b40e21ee907ec57916f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; diff-mode.el --- a mode for viewing/editing context diffs
 
-;; Copyright (C) 1998, 1999, 2000, 2001  Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
 ;; Keywords: convenience patch diff
@@ -889,8 +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 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))
@@ -901,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)