[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12488: 24.2.50; vc-delete-file and vc-rename-file should default to
From: |
Dmitry Gutov |
Subject: |
bug#12488: 24.2.50; vc-delete-file and vc-rename-file should default to the current buffer's file |
Date: |
Sat, 22 Sep 2012 22:00:56 +0400 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 |
Tags: patch
Can I go ahead and install this?
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2012-09-22 15:24:26 +0000
+++ lisp/ChangeLog 2012-09-22 17:55:12 +0000
@@ -1,3 +1,8 @@
+2012-09-22 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/vc.el (vc-delete-file, vc-rename-file): Default to the
+ current buffer's file name if it's under version control.
+
2012-09-22 Chong Yidong <cyd@gnu.org>
* repeat.el (repeat): Doc fix (Bug#12348).
=== modified file 'lisp/vc/vc.el'
--- lisp/vc/vc.el 2012-09-13 18:23:33 +0000
+++ lisp/vc/vc.el 2012-09-22 17:56:40 +0000
@@ -2562,8 +2562,11 @@
;;;###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.
+Default 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)))
@@ -2601,8 +2604,12 @@
;;;###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.
+OLD defaults 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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#12488: 24.2.50; vc-delete-file and vc-rename-file should default to the current buffer's file,
Dmitry Gutov <=