changeset 95017:7be06414cb71

Remove assumptions about buffer names.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Thu, 15 May 2008 14:32:49 +0000
parents ebce6f4852ad
children 2253b8d4def6
files lisp/ChangeLog lisp/vc-dispatcher.el lisp/vc.el
diffstat 3 files changed, 19 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu May 15 13:50:55 2008 +0000
+++ b/lisp/ChangeLog	Thu May 15 14:32:49 2008 +0000
@@ -5,6 +5,9 @@
 
 	* vc.el, vc-dispatcher.el (vc-dir-menu-map-filter): Moved.
 
+	* vc.el, vc-dispatcher.el (vc-dir-menu-map): Remove assumption
+	about buffer names.
+
 2008-05-15  Glenn Morris  <rgm@gnu.org>
 
 	* vc-hooks.el (vc-directory-resynch-file): Fix declaration.
--- a/lisp/vc-dispatcher.el	Thu May 15 13:50:55 2008 +0000
+++ b/lisp/vc-dispatcher.el	Thu May 15 14:32:49 2008 +0000
@@ -162,7 +162,7 @@
 
 ;; In a log entry buffer, this is a local variable
 ;; that points to the buffer for which it was made
-;; (either a file, or a VC directory buffer).
+;; (either a file, or a directory buffer).
 (defvar vc-parent-buffer nil)
 (put 'vc-parent-buffer 'permanent-local t)
 (defvar vc-parent-buffer-name nil)
@@ -239,7 +239,7 @@
 	(concat " " (propertize "[waiting...]"
                                 'face 'mode-line-emphasis
                                 'help-echo
-                                "A VC command is in progress in this buffer"))))
+                                "A command is in progress in this buffer"))))
 
 (defun vc-exec-after (code)
   "Eval CODE when the current buffer's process is done.
@@ -521,7 +521,7 @@
 ;; Set up key bindings for use while editing log messages
 
 (defun vc-log-edit (fileset)
-  "Set up `log-edit' for use with VC on FILE."
+  "Set up `log-edit' for use on FILE."
   (setq default-directory
 	(with-current-buffer vc-parent-buffer default-directory))
   (log-edit 'vc-finish-logentry
@@ -677,12 +677,12 @@
   ;; Must be in sync with vc-default-status-printer.
   (forward-char 25))
 
-(defun vc-dir-prepare-status-buffer (dir &optional create-new)
-  "Find a *vc-dir* buffer showing DIR, or create a new one."
+(defun vc-dir-prepare-status-buffer (bname dir &optional create-new)
+  "Find a buffer named BNAME showing DIR, or create a new one."
   (setq dir (expand-file-name dir))
-  (let* ((bname "*vc-dir*")
-	 ;; Look for another *vc-dir* buffer visiting the same directory.
-	 (buf (save-excursion
+  (let*
+	 ;; Look for another buffer name BNAME visiting the same directory.
+	 ((buf (save-excursion
 		(unless create-new
 		  (dolist (buffer (buffer-list))
 		    (set-buffer buffer)
@@ -690,7 +690,7 @@
 			       (string= (expand-file-name default-directory) dir))
 		      (return buffer)))))))
     (or buf
-        ;; Create a new *vc-dir* buffer.
+        ;; Create a new buffer named BNAME.
         (with-current-buffer (create-file-buffer bname)
           (cd dir)
           (vc-setup-buffer (current-buffer))
@@ -700,7 +700,7 @@
           (current-buffer)))))
 
 (defvar vc-dir-menu-map
-  (let ((map (make-sparse-keymap "VC-dir")))
+  (let ((map (make-sparse-keymap)))
     (define-key map [quit]
       '(menu-item "Quit" quit-window
 		  :help "Quit"))
@@ -801,7 +801,7 @@
       '(menu-item
 	;; This is used so that client modes can add mode-specific
 	;; menu items to vc-dir-menu-map.
-	"*vc-dir*" ,vc-dir-menu-map :filter vc-dir-menu-map-filter))
+	"*vc-dispatcher*" ,vc-dir-menu-map :filter vc-dir-menu-map-filter))
     map)
   "Keymap for directory buffer.")
 
@@ -1099,7 +1099,7 @@
 With a prefix argument mark all files.
 If the current entry is a directory, mark all child files.
 
-The VC commands operate on files that are on the same state.
+The commands operate on files that are on the same state.
 This command is intended to make it easy to select all files that
 share the same state."
   (interactive "P")
@@ -1176,7 +1176,7 @@
 With a prefix argument unmark all files.
 If the current entry is a directory, unmark all the child files.
 
-The VC commands operate on files that are on the same state.
+The commands operate on files that are on the same state.
 This command is intended to make it easy to deselect all files
 that share the same state."
   (interactive "P")
@@ -1316,11 +1316,11 @@
                     directory is marked
 u - marks a file/directory or if the region is active, unmark all the files
      in region.
-M - if the cursor is on a file: mark all the files with the same VC state as
+M - if the cursor is on a file: mark all the files with the same state as
       the current file
   - if the cursor is on a directory: mark all child files
   - with a prefix argument: mark all files
-U - if the cursor is on a file: unmark all the files with the same VC state
+U - if the cursor is on a file: unmark all the files with the same state
       as the current file
   - if the cursor is on a directory: unmark all child files
   - with a prefix argument: unmark all files
--- a/lisp/vc.el	Thu May 15 13:50:55 2008 +0000
+++ b/lisp/vc.el	Thu May 15 14:32:49 2008 +0000
@@ -1983,7 +1983,7 @@
 (defun vc-dir (dir)
   "Show the VC status for DIR."
   (interactive "DVC status for directory: ")
-  (pop-to-buffer (vc-dir-prepare-status-buffer dir))
+  (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir))
   (if (and (derived-mode-p 'vc-dir-mode) (boundp 'client-object))
       (vc-dir-refresh)
     ;; Otherwise, initialize a new view using the dispatcher layer