emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111065: * lisp/vc/vc.el (vc-delete-f


From: Dmitry Gutov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111065: * lisp/vc/vc.el (vc-delete-file, vc-rename-file): Default to the
Date: Mon, 03 Dec 2012 01:12:31 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111065
fixes bug: http://debbugs.gnu.org/12488
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Mon 2012-12-03 01:12:31 +0400
message:
  * lisp/vc/vc.el (vc-delete-file, vc-rename-file): Default to the
  current buffer's file name when called interactively.
modified:
  lisp/ChangeLog
  lisp/vc/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-12-02 06:41:22 +0000
+++ b/lisp/ChangeLog    2012-12-02 21:12:31 +0000
@@ -1,3 +1,8 @@
+2012-12-02  Dmitry Gutov  <address@hidden>
+
+       * 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  <address@hidden>
 
        * info.el (info-display-manual): Don't clobber an existing Info

=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el     2012-11-30 04:44:52 +0000
+++ b/lisp/vc/vc.el     2012-12-02 21:12:31 +0000
@@ -2554,8 +2554,12 @@
 
 ;;;###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 @@
 
 ;;;###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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]