]> git.eshelyaron.com Git - emacs.git/commitdiff
Bind vc-rename-file to C-x v R
authorSean Whitton <spwhitton@spwhitton.name>
Fri, 25 Jul 2025 17:45:59 +0000 (18:45 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 26 Jul 2025 13:45:44 +0000 (15:45 +0200)
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind vc-rename-file to
C-x v R.
* doc/emacs/files.texi (Copying and Naming):
* doc/emacs/vc1-xtra.texi (VC Delete/Rename, Revision Tags):
* etc/NEWS (bindings): Document the new binding.

(cherry picked from commit 09e205fe60f074e143298e306431cb62b60a890c)

doc/emacs/files.texi
doc/emacs/vc1-xtra.texi
lisp/vc/vc-hooks.el

index 08384e8f72958c916867d70099fb9f8aff243339..5abaab0d3b04c72a8c6b93769c6eb3b731685ece 100644 (file)
@@ -1993,7 +1993,7 @@ different file systems, the file @var{old} is copied and deleted.
 
 @ifnottex
   If a file is under version control (@pxref{Version Control}), you
-should rename it using @w{@kbd{M-x vc-rename-file}} instead of
+should rename it using @w{@kbd{C-x v R}} instead of
 @w{@kbd{M-x rename-file}}.  @xref{VC Delete/Rename}.
 @end ifnottex
 
index 9b35c85fba4fc99ca5a29f865cae4538faab53eb..cfa80db2b0bff8215e034b44e196ce2521018c21 100644 (file)
@@ -111,21 +111,21 @@ entry.
 @cindex renaming version-controlled files
 
 @table @kbd
-@item M-x vc-delete-file
+@item C-x v x
 Prompt for a file name, delete the file from the working tree, and
 schedule the deletion for committing.
 
-@item M-x vc-rename-file
+@item C-x v R
 Prompt for two file names, @var{old} and @var{new}, rename them in the
 working tree, and schedule the renaming for committing.  The @var{old}
 file defaults to the current buffer's file name if it is under VC.
 @end table
 
 @findex vc-delete-file
-  If you wish to delete a version-controlled file, use the command
-@kbd{M-x vc-delete-file}.  This prompts for the file name, and deletes
-it via the version control system.  The file is removed from the
-working tree, and in the VC Directory buffer
+  If you wish to delete a version-controlled file, type @kbd{C-x v x}
+(@code{vc-delete-file}).  This prompts for the file name, and deletes it
+via the version control system.  The file is removed from the working
+tree, and in the VC Directory buffer
 @iftex
 (@pxref{VC Directory Mode,,, emacs, the Emacs Manual}),
 @end iftex
@@ -136,12 +136,12 @@ it is displayed with the @samp{removed} status.  When you commit it,
 the deletion takes effect in the repository.
 
 @findex vc-rename-file
-  To rename a version-controlled file, type @kbd{M-x vc-rename-file}.
-This prompts for two arguments: the name of the file you wish to
-rename, and the new name; then it performs the renaming via the
-version control system.  The renaming takes effect immediately in the
-working tree, and takes effect in the repository when you commit the
-renamed file.
+  To rename a version-controlled file, type @kbd{C-x v R}
+(@code{vc-rename-file}).  This prompts for two arguments: the name of
+the file you wish to rename, and the new name; then it performs the
+renaming via the version control system.  The renaming takes effect
+immediately in the working tree, and takes effect in the repository when
+you commit the renamed file.
 
   On modern version control systems that have built-in support for
 renaming, the renamed file retains the full change history of the
@@ -205,7 +205,7 @@ those tags will be visible even when you bypass VC.
 
   In file-based version control systems, when you rename a registered
 file you need to rename its master along with it; the command
-@code{vc-rename-file} will do this automatically
+@kbd{C-x v R} (@code{vc-rename-file}) will do this automatically
 @iftex
 (@pxref{VC Delete/Rename,,,emacs, the Emacs Manual}).
 @end iftex
@@ -213,12 +213,12 @@ file you need to rename its master along with it; the command
 (@pxref{VC Delete/Rename}).
 @end ifnottex
 If you are using SCCS, you must also update the records of the tag, to
-mention the file by its new name (@code{vc-rename-file} does this,
+mention the file by its new name (@kbd{C-x v R} does this,
 too).  An old tag that refers to a master file that no longer exists
 under the recorded name is invalid; VC can no longer retrieve it.  It
 would be beyond the scope of this manual to explain enough about RCS
 and SCCS to explain how to update the tags by hand.  Using
-@code{vc-rename-file} makes the tag remain valid for retrieval, but it
+@kbd{C-x v R} makes the tag remain valid for retrieval, but it
 does not solve all problems.  For example, some of the files in your
 program probably refer to others by name.  At the very least, the
 makefile probably mentions the file that you renamed.  If you retrieve
index 3945e5c10cd935f8fa5e68cc582f68eeddf68052..7907519346afe351333004fed3a28e680b9a9bdc 100644 (file)
@@ -968,6 +968,7 @@ In the latter case, VC mode is deactivated for this buffer."
   "="   #'vc-diff
   "D"   #'vc-root-diff
   "~"   #'vc-revision-other-window
+  "R"   #'vc-rename-file
   "x"   #'vc-delete-file
   "!"   #'vc-edit-next-command)
 (fset 'vc-prefix-map vc-prefix-map)