aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov2012-12-03 01:12:31 +0400
committerDmitry Gutov2012-12-03 01:12:31 +0400
commitdb47d5e975dc5bd647f7c6132e7f9eb196f2614f (patch)
treefcbdbca758e509819983433414534db6e0fe1782 /lisp
parent21e54a94d7527e07ddc37066c8cb488f478339c9 (diff)
downloademacs-db47d5e975dc5bd647f7c6132e7f9eb196f2614f.tar.gz
emacs-db47d5e975dc5bd647f7c6132e7f9eb196f2614f.zip
* 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/ChangeLog5
-rw-r--r--lisp/vc/vc.el17
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 @@
12012-12-02 Dmitry Gutov <dgutov@yandex.ru>
2
3 * vc/vc.el (vc-delete-file, vc-rename-file): Default to the
4 current buffer's file name when called interactively (Bug#12488).
5
12012-12-02 Juri Linkov <juri@jurta.org> 62012-12-02 Juri Linkov <juri@jurta.org>
2 7
3 * info.el (info-display-manual): Don't clobber an existing Info 8 * 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.
2554 2554
2555;;;###autoload 2555;;;###autoload
2556(defun vc-delete-file (file) 2556(defun vc-delete-file (file)
2557 "Delete file and mark it as such in the version control system." 2557 "Delete file and mark it as such in the version control system.
2558 (interactive "fVC delete file: ") 2558If called interactively, read FILE, defaulting to the current
2559buffer's file name if it's under version control."
2560 (interactive (list (read-file-name "VC delete file: " nil
2561 (when (vc-backend buffer-file-name)
2562 buffer-file-name) t)))
2559 (setq file (expand-file-name file)) 2563 (setq file (expand-file-name file))
2560 (let ((buf (get-file-buffer file)) 2564 (let ((buf (get-file-buffer file))
2561 (backend (vc-backend file))) 2565 (backend (vc-backend file)))
@@ -2593,8 +2597,13 @@ backend to NEW-BACKEND, and unregister FILE from the current backend.
2593 2597
2594;;;###autoload 2598;;;###autoload
2595(defun vc-rename-file (old new) 2599(defun vc-rename-file (old new)
2596 "Rename file OLD to NEW in both work area and repository." 2600 "Rename file OLD to NEW in both work area and repository.
2597 (interactive "fVC rename file: \nFRename to: ") 2601If called interactively, read OLD and NEW, defaulting OLD to the
2602current buffer's file name if it's under version control."
2603 (interactive (list (read-file-name "VC rename file: " nil
2604 (when (vc-backend buffer-file-name)
2605 buffer-file-name) t)
2606 (read-file-name "Rename to: ")))
2598 ;; in CL I would have said (setq new (merge-pathnames new old)) 2607 ;; in CL I would have said (setq new (merge-pathnames new old))
2599 (let ((old-base (file-name-nondirectory old))) 2608 (let ((old-base (file-name-nondirectory old)))
2600 (when (and (not (string= "" old-base)) 2609 (when (and (not (string= "" old-base))