# HG changeset patch # User Dan Nicolaescu # Date 1194792956 0 # Node ID 430cc8630a39d855ae12a9eb28d166e0fb31c585 # Parent 4a4d5773bb72b42e24e0fd4860e8e2d173fde72d (vc-start-entry): Fix setting the in the case the function is called from vc-dired. Use when instead of if where appropriate. diff -r 4a4d5773bb72 -r 430cc8630a39 lisp/ChangeLog --- a/lisp/ChangeLog Sun Nov 11 14:18:17 2007 +0000 +++ b/lisp/ChangeLog Sun Nov 11 14:55:56 2007 +0000 @@ -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 -r 4a4d5773bb72 -r 430cc8630a39 lisp/vc.el --- a/lisp/vc.el Sun Nov 11 14:18:17 2007 +0000 +++ b/lisp/vc.el Sun Nov 11 14:55:56 2007 +0000 @@ -1637,14 +1637,18 @@ \(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 @@ ;;(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