From: Alexandre Julliard Date: Sat, 11 Aug 2007 10:23:21 +0000 (+0200) Subject: git.el: Always set the current directory in the git-diff buffer. X-Git-Tag: v1.5.3-rc5~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8fdc39729b9aaa02e89eca9d7964182a72052665;p=git.git git.el: Always set the current directory in the git-diff buffer. This allows jumping to the correct file with the diff-mode commands. Signed-off-by: Alexandre Julliard Signed-off-by: Junio C Hamano --- diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el index 214b75cf9..be44e06c4 100644 --- a/contrib/emacs/git.el +++ b/contrib/emacs/git.el @@ -912,10 +912,12 @@ Return the list of files that haven't been handled." (defun git-setup-diff-buffer (buffer) "Setup a buffer for displaying a diff." - (with-current-buffer buffer - (diff-mode) - (goto-char (point-min)) - (setq buffer-read-only t)) + (let ((dir default-directory)) + (with-current-buffer buffer + (diff-mode) + (goto-char (point-min)) + (setq default-directory dir) + (setq buffer-read-only t))) (display-buffer buffer) (shrink-window-if-larger-than-buffer))