diff options
author | Glenn Morris <rgm@gnu.org> | 2008-01-08 05:17:47 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2008-01-08 05:17:47 +0000 |
commit | 1c58b439bfa0823ff1fd6e43eeba52d4e2fedbaf (patch) | |
tree | d57baab7bb98ae214f02cc8d3ce37e77d8484ec5 /lisp | |
parent | 0595c9f92fc6fe05951d567e2aa9976e78e72843 (diff) | |
download | emacs-1c58b439bfa0823ff1fd6e43eeba52d4e2fedbaf.tar.gz |
(diff-end-of-hunk): Don't match empty lines in unified format.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 3 | ||||
-rw-r--r-- | lisp/diff-mode.el | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 21205e3f8b1..a0825f79441 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2008-01-08 Glenn Morris <rgm@gnu.org> + * diff-mode.el (diff-end-of-hunk): Don't match empty lines in + unified format. + * mouse.el (mouse-major-mode-menu): Suppress duplicate menus. 2008-01-08 Ralf Angeli <angeli@caeruleus.net> diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index 9e9eb81797a..6291453ba17 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -1,7 +1,7 @@ ;;; diff-mode.el --- a mode for viewing/editing context diffs ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007 Free Software Foundation, Inc. +;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Author: Stefan Monnier <monnier@iro.umontreal.ca> ;; Keywords: convenience patch diff @@ -401,9 +401,13 @@ when editing big diffs)." (defun diff-end-of-hunk (&optional style) ;; Especially important for unified (because headers are ambiguous). (setq style (diff-hunk-style style)) + ;; Some versions of diff replace all-blank context lines in unified + ;; format with empty lines. The use of \n below avoids matching such + ;; lines as headers. + ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html (let ((end (and (re-search-forward (case style ;; A `unified' header is ambiguous. - (unified (concat "^[^-+# \\]\\|" + (unified (concat "^[^-+# \\\n]\\|" diff-file-header-re)) (context "^[^-+#! \\]") (normal "^[^<>#\\]") |