summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>2000-08-29 14:38:49 +0000
committerDave Love <fx@gnu.org>2000-08-29 14:38:49 +0000
commitccce6558aff7541ec8551caf311659433842c575 (patch)
treefa2b11ac4495132740db77769ca029211f68d515 /lisp/diff-mode.el
parente34786c92e3428bb0c65921179814a6c4569de82 (diff)
downloademacs-ccce6558aff7541ec8551caf311659433842c575.tar.gz
(diff-mode) <defgroup>: Add :version.
(diff-mode-shared-map): Bind mouse-2. (diff-imenu-generic-expression): New variable. (diff-mode): Use it.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el17
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 @@
;;; diff-mode.el --- A mode for viewing/editing context diffs
-;; Copyright (C) 1998-1999 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@cs.yale.edu>
;; Keywords: patch diff
-;; Revision: $Id: diff-mode.el,v 1.8 2000/06/05 07:30:09 monnier Exp $
+;; Revision: $Id: diff-mode.el,v 1.9 2000/08/16 19:56:10 monnier Exp $
;; This file is part of GNU Emacs.
@@ -57,7 +57,6 @@
;; This mostly means ability to jump from half-hunk to half-hunk
;; in context (and normal) diffs and to jump to the corresponding
;; (i.e. new or old) file.
-;; - imenu support.
;; - Handle `diff -b' output in context->unified.
;;; Code:
@@ -67,6 +66,7 @@
(defgroup diff-mode ()
"Major-mode for viewing/editing diffs"
+ :version "21.1"
:group 'tools
:group 'diff)
@@ -108,6 +108,7 @@ when editing big diffs)."
("}" . diff-file-next)
("{" . diff-file-prev)
("\C-m" . diff-goto-source)
+ ([mouse-2] . diff-mouse-goto-source)
;; From XEmacs' diff-mode.
("W" . widen)
;;("." . diff-goto-source) ;display-buffer
@@ -220,6 +221,12 @@ when editing big diffs)."
(defconst diff-font-lock-defaults
'(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil)))
+(defvar diff-imenu-generic-expression
+ ;; Prefer second name as first is most likely to be a backup or
+ ;; version-control name.
+ '((nil "\\+\\+\\+\\ \\([^\t\n]+\\)\t" 1) ; unidiffs
+ (nil "^--- \\([^\t\n]+\\)\t.*\n\\*" 1))) ; context diffs
+
;;;;
;;;; Compile support
;;;;
@@ -813,7 +820,9 @@ This mode runs `diff-mode-hook'.
\\{diff-mode-map}"
(set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults)
(set (make-local-variable 'outline-regexp) diff-outline-regexp)
- ;; compile support
+ (set (make-local-variable 'imenu-generic-expression)
+ diff-imenu-generic-expression)
+ ;; compile support
(set (make-local-variable 'compilation-file-regexp-alist)
diff-file-regexp-alist)
(set (make-local-variable 'compilation-error-regexp-alist)