diff options
| author | Dmitry Gutov <dgutov@yandex.ru> | 2012-12-03 01:12:31 +0400 |
|---|---|---|
| committer | Dmitry Gutov <dgutov@yandex.ru> | 2012-12-03 01:12:31 +0400 |
| commit | db47d5e975dc5bd647f7c6132e7f9eb196f2614f (patch) | |
| tree | fcbdbca758e509819983433414534db6e0fe1782 /lisp | |
| parent | 21e54a94d7527e07ddc37066c8cb488f478339c9 (diff) | |
| download | emacs-db47d5e975dc5bd647f7c6132e7f9eb196f2614f.tar.gz | |
* lisp/vc/vc.el (vc-delete-file, vc-rename-file): Default to the
current buffer's file name when called interactively.
Fixes: debbugs:12488
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6032211b76f..59622c72678 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-02 Dmitry Gutov <dgutov@yandex.ru> + + * vc/vc.el (vc-delete-file, vc-rename-file): Default to the + current buffer's file name when called interactively (Bug#12488). + 2012-12-02 Juri Linkov <juri@jurta.org> * info.el (info-display-manual): Don't clobber an existing Info diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0224211e6cf..d001df87d5c 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2554,8 +2554,12 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. ;;;###autoload (defun vc-delete-file (file) - "Delete file and mark it as such in the version control system." - (interactive "fVC delete file: ") + "Delete file and mark it as such in the version control system. +If called interactively, read FILE, defaulting to the current +buffer's file name if it's under version control." + (interactive (list (read-file-name "VC delete file: " nil + (when (vc-backend buffer-file-name) + buffer-file-name) t))) (setq file (expand-file-name file)) (let ((buf (get-file-buffer file)) (backend (vc-backend file))) @@ -2593,8 +2597,13 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. ;;;###autoload (defun vc-rename-file (old new) - "Rename file OLD to NEW in both work area and repository." - (interactive "fVC rename file: \nFRename to: ") + "Rename file OLD to NEW in both work area and repository. +If called interactively, read OLD and NEW, defaulting OLD to the +current buffer's file name if it's under version control." + (interactive (list (read-file-name "VC rename file: " nil + (when (vc-backend buffer-file-name) + buffer-file-name) t) + (read-file-name "Rename to: "))) ;; in CL I would have said (setq new (merge-pathnames new old)) (let ((old-base (file-name-nondirectory old))) (when (and (not (string= "" old-base)) |
