diff options
| author | Dan Nicolaescu <dann@ics.uci.edu> | 2008-04-04 22:34:35 +0000 |
|---|---|---|
| committer | Dan Nicolaescu <dann@ics.uci.edu> | 2008-04-04 22:34:35 +0000 |
| commit | 19446c41b170a489d00d551914b781b9e74c54bb (patch) | |
| tree | 6381d3ee7f152226d5ccb6d66d5a59d76810b402 | |
| parent | 479be3f4baad1d358b8c47ef6fd0698a6617a588 (diff) | |
| download | emacs-19446c41b170a489d00d551914b781b9e74c54bb.tar.gz | |
(diff-file-junk-re): Recognize the git format for
new files.
(diff-mode): Set beginning-of-defun-function and
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/diff-mode.el | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 866d101c41e..923010c1fdb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index e89aa0e3334..48b8f18a132 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -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) |
