diff options
| author | Dave Love | 2000-08-29 14:38:49 +0000 |
|---|---|---|
| committer | Dave Love | 2000-08-29 14:38:49 +0000 |
| commit | ccce6558aff7541ec8551caf311659433842c575 (patch) | |
| tree | fa2b11ac4495132740db77769ca029211f68d515 | |
| parent | e34786c92e3428bb0c65921179814a6c4569de82 (diff) | |
| download | emacs-ccce6558aff7541ec8551caf311659433842c575.tar.gz emacs-ccce6558aff7541ec8551caf311659433842c575.zip | |
(diff-mode) <defgroup>: Add :version.
(diff-mode-shared-map): Bind mouse-2.
(diff-imenu-generic-expression): New variable.
(diff-mode): Use it.
| -rw-r--r-- | lisp/diff-mode.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 1775a0165b3..d27f401fe09 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | ;;; diff-mode.el --- A mode for viewing/editing context diffs | 1 | ;;; diff-mode.el --- A mode for viewing/editing context diffs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998-1999 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 5 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> |
| 6 | ;; Keywords: patch diff | 6 | ;; Keywords: patch diff |
| 7 | ;; Revision: $Id: diff-mode.el,v 1.8 2000/06/05 07:30:09 monnier Exp $ | 7 | ;; Revision: $Id: diff-mode.el,v 1.9 2000/08/16 19:56:10 monnier Exp $ |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| @@ -57,7 +57,6 @@ | |||
| 57 | ;; This mostly means ability to jump from half-hunk to half-hunk | 57 | ;; This mostly means ability to jump from half-hunk to half-hunk |
| 58 | ;; in context (and normal) diffs and to jump to the corresponding | 58 | ;; in context (and normal) diffs and to jump to the corresponding |
| 59 | ;; (i.e. new or old) file. | 59 | ;; (i.e. new or old) file. |
| 60 | ;; - imenu support. | ||
| 61 | ;; - Handle `diff -b' output in context->unified. | 60 | ;; - Handle `diff -b' output in context->unified. |
| 62 | 61 | ||
| 63 | ;;; Code: | 62 | ;;; Code: |
| @@ -67,6 +66,7 @@ | |||
| 67 | 66 | ||
| 68 | (defgroup diff-mode () | 67 | (defgroup diff-mode () |
| 69 | "Major-mode for viewing/editing diffs" | 68 | "Major-mode for viewing/editing diffs" |
| 69 | :version "21.1" | ||
| 70 | :group 'tools | 70 | :group 'tools |
| 71 | :group 'diff) | 71 | :group 'diff) |
| 72 | 72 | ||
| @@ -108,6 +108,7 @@ when editing big diffs)." | |||
| 108 | ("}" . diff-file-next) | 108 | ("}" . diff-file-next) |
| 109 | ("{" . diff-file-prev) | 109 | ("{" . diff-file-prev) |
| 110 | ("\C-m" . diff-goto-source) | 110 | ("\C-m" . diff-goto-source) |
| 111 | ([mouse-2] . diff-mouse-goto-source) | ||
| 111 | ;; From XEmacs' diff-mode. | 112 | ;; From XEmacs' diff-mode. |
| 112 | ("W" . widen) | 113 | ("W" . widen) |
| 113 | ;;("." . diff-goto-source) ;display-buffer | 114 | ;;("." . diff-goto-source) ;display-buffer |
| @@ -220,6 +221,12 @@ when editing big diffs)." | |||
| 220 | (defconst diff-font-lock-defaults | 221 | (defconst diff-font-lock-defaults |
| 221 | '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil))) | 222 | '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil))) |
| 222 | 223 | ||
| 224 | (defvar diff-imenu-generic-expression | ||
| 225 | ;; Prefer second name as first is most likely to be a backup or | ||
| 226 | ;; version-control name. | ||
| 227 | '((nil "\\+\\+\\+\\ \\([^\t\n]+\\)\t" 1) ; unidiffs | ||
| 228 | (nil "^--- \\([^\t\n]+\\)\t.*\n\\*" 1))) ; context diffs | ||
| 229 | |||
| 223 | ;;;; | 230 | ;;;; |
| 224 | ;;;; Compile support | 231 | ;;;; Compile support |
| 225 | ;;;; | 232 | ;;;; |
| @@ -813,7 +820,9 @@ This mode runs `diff-mode-hook'. | |||
| 813 | \\{diff-mode-map}" | 820 | \\{diff-mode-map}" |
| 814 | (set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults) | 821 | (set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults) |
| 815 | (set (make-local-variable 'outline-regexp) diff-outline-regexp) | 822 | (set (make-local-variable 'outline-regexp) diff-outline-regexp) |
| 816 | ;; compile support | 823 | (set (make-local-variable 'imenu-generic-expression) |
| 824 | diff-imenu-generic-expression) | ||
| 825 | ;; compile support | ||
| 817 | (set (make-local-variable 'compilation-file-regexp-alist) | 826 | (set (make-local-variable 'compilation-file-regexp-alist) |
| 818 | diff-file-regexp-alist) | 827 | diff-file-regexp-alist) |
| 819 | (set (make-local-variable 'compilation-error-regexp-alist) | 828 | (set (make-local-variable 'compilation-error-regexp-alist) |