Mercurial > emacs
diff lisp/vc-dir.el @ 96411:31e595cb6c02
(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.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Sun, 29 Jun 2008 12:50:20 +0000 |
parents | 02d657f45045 |
children | 9a72b6660355 |
line wrap: on
line diff
--- a/lisp/vc-dir.el Sun Jun 29 08:10:56 2008 +0000 +++ b/lisp/vc-dir.el Sun Jun 29 12:50:20 2008 +0000 @@ -990,9 +990,10 @@ (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 @@ (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)