]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-dir): Make backend argument optional and use
authorAndreas Schwab <schwab@suse.de>
Sun, 29 Jun 2008 12:50:20 +0000 (12:50 +0000)
committerAndreas Schwab <schwab@suse.de>
Sun, 29 Jun 2008 12:50:20 +0000 (12:50 +0000)
vc-responsible-backend when nil.  Interactively pass nil for
backend instead of using the backend of what happens to be
default-directory at the time of the call.

lisp/ChangeLog
lisp/vc-dir.el

index 0d6fcd65e59695036b343ba38bf768015446ddf7..c81b63998da89096aef56118dad0335dbf830284 100644 (file)
@@ -1,5 +1,10 @@
 2008-06-29  Andreas Schwab  <schwab@suse.de>
 
+       * vc-dir.el (vc-dir): Make backend argument optional and use
+       vc-responsible-backend when nil.  Interactively pass nil for
+       backend instead of using the backend of what happens to be
+       default-directory at the time of the call.
+
        * find-dired.el (find-dired-filter): Preserve point.
 
 2008-06-28  Juanma Barranquero  <lekktu@gmail.com>
index df7caca120c1e891394f2acd5815c00d1da770cc..ac591c64941762d06d524d467cab139f2f1d25cc 100644 (file)
@@ -990,9 +990,10 @@ outside of VC) and one wants to do some operation on it."
     (list vc-dir-backend files only-files-list state model)))
 
 ;;;###autoload
-(defun vc-dir (dir backend)
+(defun vc-dir (dir &optional backend)
   "Show the VC status for DIR.
-With a prefix argument ask what VC backend to use."
+Optional second argument BACKEND specifies the VC backend to use.
+Interactively, a prefix argument means to ask for the backend."
   (interactive
    (list
     (read-file-name "VC status for directory: "
@@ -1002,9 +1003,11 @@ With a prefix argument ask what VC backend to use."
        (intern
         (completing-read
          "Use VC backend: "
-         (mapcar (lambda (b) (list (symbol-name b))) vc-handled-backends)
-         nil t nil nil))
-      (vc-responsible-backend default-directory))))
+         (mapcar (lambda (b) (list (symbol-name b)))
+                 vc-handled-backends)
+         nil t nil nil)))))
+  (unless backend
+    (setq backend (vc-responsible-backend dir)))
   (pop-to-buffer (vc-dir-prepare-status-buffer "*vc-dir*" dir backend))
   (if (derived-mode-p 'vc-dir-mode)
       (vc-dir-refresh)