diff options
author | Andreas Schwab <schwab@suse.de> | 2008-06-29 12:50:20 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2008-06-29 12:50:20 +0000 |
commit | b861de913e16a1bd216e87797cae1a8d1c0d8421 (patch) | |
tree | ee424d297b246692ab9efc13e64ece8bd371f8f9 /lisp/vc-dir.el | |
parent | 2cd119e329ebe1a50caeea3163021ead3ebbe7b0 (diff) |
(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.
Diffstat (limited to 'lisp/vc-dir.el')
-rw-r--r-- | lisp/vc-dir.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el index df7caca120..ac591c6494 100644 --- a/lisp/vc-dir.el +++ b/lisp/vc-dir.el @@ -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) |