(diff-file-header-re): Tighten up regexp a tiny bit.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 29 Sep 2004 17:42:50 +0000 (17:42 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 29 Sep 2004 17:42:50 +0000 (17:42 +0000)
(diff-fixup-modifs): Catch unified-diff file-headers.

lisp/ChangeLog
lisp/diff-mode.el

index 187fc60..e01cd9f 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * diff-mode.el (diff-file-header-re): Tighten up regexp a tiny bit.
+       (diff-fixup-modifs): Catch unified-diff file-headers.
+
 2004-09-28  Stefan  <monnier@iro.umontreal.ca>
 
        * dired.el (dired-view-command-alist): Use more efficient regexps.
@@ -35,8 +40,8 @@
        (pr-version): New version number (6.8.1).
        (pr-ps-file-using-ghostscript): Use make-temp-file instead of
        make-temp-name.
-       (pr-delete-file): Check if file exists before deleting it.  Reported by
-       Lennart Borgman <lennart.borgman.073@student.lu.se>.
+       (pr-delete-file): Check if file exists before deleting it.
+       Reported by Lennart Borgman <lennart.borgman.073@student.lu.se>.
 
 2004-09-26  Stefan  <monnier@iro.umontreal.ca>
 
 2004-09-26  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * term.el (term-ansi-at-eval-string, term-ansi-default-fg)
-       (term-ansi-default-bg, term-ansi-current-temp): Delete unused
-       vars.
+       (term-ansi-default-bg, term-ansi-current-temp): Delete unused vars.
        (map): Bind S-prior, S-next and S-insert.
        (term-mode): Set `indent-tabs-mode' to nil.
        (term-paste): New function to be bound to S-insert.
        (term-send-del, term-send-backspace): Change the strings sent.
        (term-termcap-format): Synchronyze with etc/e/eterm.ti.
        (term-handle-colors-array): Fix handling of underline and reverse.
-       (term-handle-ansi-escape): Do not handle smcup/rmcup. Add
-       comments.
+       (term-handle-ansi-escape): Do not handle smcup/rmcup.  Add comments.
        (term-erase-in-line): Fix comparison.
-        (term-emulate-terminal): Fix line wrap handling.
-       (term-start-output-log): Renamed from `term-set-output-log'.
-       (term-stop-output-log): Renamed from `term-stop-photo'.
-        (term-switch-to-alternate-sub-buffer): Comment out, unused.
+       (term-emulate-terminal): Fix line wrap handling.
+       (term-start-output-log): Rename from `term-set-output-log'.
+       (term-stop-output-log): Rename from `term-stop-photo'.
+       (term-switch-to-alternate-sub-buffer): Comment out, unused.
 
 2004-09-25  Stefan  <monnier@iro.umontreal.ca>
 
index 21b1c64..0a7f1a1 100644 (file)
@@ -301,7 +301,7 @@ when editing big diffs)."
 ;;;;
 
 (defconst diff-hunk-header-re "^\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$")
-(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+\\|\\*\\*\\* .+\n---\\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1)))
+(defconst diff-file-header-re (concat "^\\(--- .+\n\\+\\+\\+ \\|\\*\\*\\* .+\n--- \\|[^-+!<>0-9@* ]\\).+\n" (substring diff-hunk-header-re 1)))
 (defvar diff-narrowed-to nil)
 
 (defun diff-end-of-hunk (&optional style)
@@ -798,9 +798,12 @@ else cover the whole bufer."
       (goto-char end) (diff-end-of-hunk)
       (let ((plus 0) (minus 0) (space 0) (bang 0))
        (while (and (= (forward-line -1) 0) (<= start (point)))
-         (if (not (looking-at "\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|[-*][-*][-*] .+ [-*][-*][-*][-*]\\)$"))
+         (if (not (looking-at
+                   (concat "@@ -[0-9,]+ \\+[0-9,]+ @@"
+                           "\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$"
+                           "\\|--- .+\n\\+\\+\\+ ")))
              (case (char-after)
-               (?\  (incf space))
+               (?\s (incf space))
                (?+ (incf plus))
                (?- (incf minus))
                (?! (incf bang))