# HG changeset patch # User Dan Nicolaescu # Date 1207348475 0 # Node ID 928315b10669a9a7a2286b31772d6d7ad29efb25 # Parent 94eba6d98635d7d9f353709ea3f3fb5a77de76bd (diff-file-junk-re): Recognize the git format for new files. (diff-mode): Set beginning-of-defun-function and diff -r 94eba6d98635 -r 928315b10669 lisp/ChangeLog --- a/lisp/ChangeLog Fri Apr 04 22:29:55 2008 +0000 +++ b/lisp/ChangeLog Fri Apr 04 22:34:35 2008 +0000 @@ -1,5 +1,10 @@ 2008-04-04 Dan Nicolaescu + * 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. diff -r 94eba6d98635 -r 928315b10669 lisp/diff-mode.el --- a/lisp/diff-mode.el Fri Apr 04 22:29:55 2008 +0000 +++ b/lisp/diff-mode.el Fri Apr 04 22:34:35 2008 +0000 @@ -556,7 +556,8 @@ (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 @@ ;; 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)