(vc-start-entry): Fix setting the in the case the function
authorDan Nicolaescu <dann@ics.uci.edu>
Sun, 11 Nov 2007 14:55:56 +0000 (14:55 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Sun, 11 Nov 2007 14:55:56 +0000 (14:55 +0000)
is called from vc-dired.  Use when instead of if where
appropriate.

lisp/ChangeLog
lisp/vc.el

index d1f4f81..6596261 100644 (file)
@@ -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
index 5811b2f..3661d6b 100644 (file)
@@ -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