From c27f56ee33bed045d5171d2d273329d65068ec5f Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sun, 11 Nov 2007 14:55:56 +0000 Subject: [PATCH] (vc-start-entry): Fix setting the in the case the function is called from vc-dired. Use when instead of if where appropriate. --- lisp/ChangeLog | 6 ++++++ lisp/vc.el | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1f4f81e835..65962613866 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-11-11 Dan Nicolaescu + + * vc.el (vc-start-entry): Fix setting the in the case the function + is called from vc-dired. Use when instead of if where + appropriate. + 2007-11-11 Vinicius Jose Latorre * ps-print.el (ps-do-despool): Do not force ps-lpr-switches to be a diff --git a/lisp/vc.el b/lisp/vc.el index 5811b2f7d63..3661d6b8609 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1637,14 +1637,18 @@ empty comment. Remember the file's buffer in `vc-parent-buffer' \(current one if no file). AFTER-HOOK specifies the local value for vc-log-operation-hook." (let ((parent - (if (and files (equal (length files) 1)) - (get-file-buffer (car files)) - (current-buffer)))) - (if vc-before-checkin-hook - (if files - (with-current-buffer parent - (run-hooks 'vc-before-checkin-hook)) - (run-hooks 'vc-before-checkin-hook))) + (if (eq major-mode 'vc-dired-mode) + ;; If we are called from VC dired, the parent buffer is + ;; the current buffer. + (current-buffer) + (if (and files (equal (length files) 1)) + (get-file-buffer (car files)) + (current-buffer))))) + (when vc-before-checkin-hook + (if files + (with-current-buffer parent + (run-hooks 'vc-before-checkin-hook)) + (run-hooks 'vc-before-checkin-hook))) (if (and comment (not initial-contents)) (set-buffer (get-buffer-create "*VC-log*")) (pop-to-buffer (get-buffer-create "*VC-log*"))) @@ -1654,8 +1658,8 @@ for vc-log-operation-hook." ;;(if file (vc-mode-line file)) (vc-log-edit files) (make-local-variable 'vc-log-after-operation-hook) - (if after-hook - (setq vc-log-after-operation-hook after-hook)) + (when after-hook + (setq vc-log-after-operation-hook after-hook)) (setq vc-log-operation action) (setq vc-log-revision rev) (when comment -- 2.39.2