changeset 86034:430cc8630a39

(vc-start-entry): Fix setting the in the case the function is called from vc-dired. Use when instead of if where appropriate.
author Dan Nicolaescu <dann@ics.uci.edu>
date Sun, 11 Nov 2007 14:55:56 +0000
parents 4a4d5773bb72
children d3745283de5f
files lisp/ChangeLog lisp/vc.el
diffstat 2 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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  <dann@ics.uci.edu>
+
+	* 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  <viniciusjl@ig.com.br>
 
 	* ps-print.el (ps-do-despool): Do not force ps-lpr-switches to be a
--- 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