]> git.eshelyaron.com Git - emacs.git/commitdiff
(diff-file-junk-re): Recognize the git format for
authorDan Nicolaescu <dann@ics.uci.edu>
Fri, 4 Apr 2008 22:34:35 +0000 (22:34 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Fri, 4 Apr 2008 22:34:35 +0000 (22:34 +0000)
new files.
(diff-mode): Set beginning-of-defun-function and

lisp/ChangeLog
lisp/diff-mode.el

index 866d101c41ee293adbe12a33fdd8a5ef57f7b3e3..923010c1fdb1183dcfd5d323c3dd3c26a1b15f48 100644 (file)
@@ -1,5 +1,10 @@
 2008-04-04  Dan Nicolaescu  <dann@ics.uci.edu>
 
+       * diff-mode.el (diff-file-junk-re): Recognize the git format for
+       new files.
+       (diff-mode): Set beginning-of-defun-function and
+       end-of-defun-function.
+
        * vc-bzr.el (vc-bzr-state): Use when instead of if.
 
        * vc.el (vc-default-status-fileinfo-extra): New function.
index e89aa0e333415dc5d06f4b50bd530f2d6055e8b2..48b8f18a132e6d450ea13ef2a092fb914ff1dad7 100644 (file)
@@ -556,7 +556,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
       (diff-end-of-hunk)
       (kill-region start (point)))))
 
-(defconst diff-file-junk-re "diff \\|index ") ; "index " is output by git-diff.
+;; "index " and "new file mode" are output by git-diff.
+(defconst diff-file-junk-re "diff \\|index \\|new file mode")
 
 (defun diff-beginning-of-file-and-junk ()
   "Go to the beginning of file-related diff-info.
@@ -1237,6 +1238,11 @@ a diff with \\[diff-reverse-direction].
   ;; compile support
   (set (make-local-variable 'next-error-function) 'diff-next-error)
 
+  (set (make-local-variable 'beginning-of-defun-function)
+       'diff-beginning-of-file-and-junk)
+  (set (make-local-variable 'end-of-defun-function)
+       'diff-end-of-file)
+
   (setq buffer-read-only diff-default-read-only)
   ;; setup change hooks
   (if (not diff-update-on-the-fly)