changeset 95018:2253b8d4def6

More elimination of buffer name dependencies.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Thu, 15 May 2008 15:01:29 +0000
parents 7be06414cb71
children dacdc18f78bd
files lisp/vc-dispatcher.el lisp/vc.el
diffstat 2 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-dispatcher.el	Thu May 15 14:32:49 2008 +0000
+++ b/lisp/vc-dispatcher.el	Thu May 15 15:01:29 2008 +0000
@@ -135,7 +135,7 @@
   :group 'vc)
 
 (defcustom vc-delete-logbuf-window t
-  "If non-nil, delete the *VC-log* buffer and window after each logical action.
+  "If non-nil, delete the log buffer and window after each logical action.
 If nil, bury that buffer instead.
 This is most useful if you have multiple windows on a frame and would like to
 preserve the setting."
@@ -533,9 +533,9 @@
   (set-buffer-modified-p nil)
   (setq buffer-file-name nil))
 
-(defun vc-start-logentry (files extra comment initial-contents msg action &optional after-hook)
+(defun vc-start-logentry (files extra comment initial-contents msg logbuf action &optional after-hook)
   "Accept a comment for an operation on FILES with extra data EXTRA.
-If COMMENT is nil, pop up a VC-log buffer, emit MSG, and set the
+If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
 action on close to ACTION.  If COMMENT is a string and
 INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial
 contents of the log entry buffer.  If COMMENT is a string and
@@ -553,8 +553,8 @@
                (get-file-buffer (car files))
              (current-buffer)))))
     (if (and comment (not initial-contents))
-	(set-buffer (get-buffer-create "*VC-log*"))
-      (pop-to-buffer (get-buffer-create "*VC-log*")))
+	(set-buffer (get-buffer-create logbuf))
+      (pop-to-buffer (get-buffer-create logbuf)))
     (set (make-local-variable 'vc-parent-buffer) parent)
     (set (make-local-variable 'vc-parent-buffer-name)
 	 (concat " from " (buffer-name vc-parent-buffer)))
@@ -587,7 +587,8 @@
   (unless vc-log-operation
     (error "No log operation is pending"))
   ;; save the parameters held in buffer-local variables
-  (let ((log-operation vc-log-operation)
+  (let ((logbuf (current-buffer))
+	(log-operation vc-log-operation)
 	(log-fileset vc-log-fileset)
 	(log-extra vc-log-extra)
 	(log-entry (buffer-string))
@@ -603,14 +604,13 @@
     ;; Remove checkin window (after the checkin so that if that fails
     ;; we don't zap the *VC-log* buffer and the typing therein).
     ;; -- IMO this should be replaced with quit-window
-    (let ((logbuf (get-buffer "*VC-log*")))
-      (cond ((and logbuf vc-delete-logbuf-window)
-	     (delete-windows-on logbuf (selected-frame))
-	     ;; Kill buffer and delete any other dedicated windows/frames.
-	     (kill-buffer logbuf))
-	    (logbuf (pop-to-buffer "*VC-log*")
-		    (bury-buffer)
-		    (pop-to-buffer tmp-vc-parent-buffer))))
+    (cond ((and logbuf vc-delete-logbuf-window)
+	   (delete-windows-on logbuf (selected-frame))
+	   ;; Kill buffer and delete any other dedicated windows/frames.
+	   (kill-buffer logbuf))
+	  (logbuf (pop-to-buffer logbuf)
+		  (bury-buffer)
+		  (pop-to-buffer tmp-vc-parent-buffer)))
     ;; Now make sure we see the expanded headers
     (when log-fileset
       (mapc
--- a/lisp/vc.el	Thu May 15 14:32:49 2008 +0000
+++ b/lisp/vc.el	Thu May 15 15:01:29 2008 +0000
@@ -1286,6 +1286,7 @@
 		    (or comment (not vc-initial-comment))
 		    nil
 		    "Enter initial comment."
+		    "*VC-log*"
 		    (lambda (files rev comment)
 		      (dolist (file files)
 			(message "Registering %s... " file)
@@ -1388,6 +1389,7 @@
   (vc-start-logentry
    files rev comment initial-contents
    "Enter a change comment."
+   "*VC-log*"
    (lambda (files rev comment)
      (message "Checking in %s..." (vc-delistify files))
      ;; "This log message intentionally left almost blank".
@@ -1728,6 +1730,7 @@
   (vc-start-logentry
    files rev oldcomment t
    "Enter a replacement change comment."
+   "*VC-log*"
    (lambda (files rev comment)
      (vc-call-backend
       ;; Less of a kluge than it looks like; log-view mode only passes