emacs-diffs
[Top][All Lists]
Advanced

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

master e0c9399: Add more commands to the new `C-x x' keymap


From: Lars Ingebrigtsen
Subject: master e0c9399: Add more commands to the new `C-x x' keymap
Date: Sun, 7 Feb 2021 07:54:16 -0500 (EST)

branch: master
commit e0c9399454838444e0cc8c6c1fc1d307d9e9752b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add more commands to the new `C-x x' keymap
    
    * doc/emacs/killing.texi (Accumulating Text):
    * doc/emacs/display.texi (Line Truncation):
    * doc/emacs/buffers.texi (Misc Buffer): Document it.
    
    * lisp/bindings.el (ctl-x-x-map): Add new bindings for
    rename-buffer, rename-uniquely, insert-buffer and
    toggle-truncate-lines.
---
 doc/emacs/buffers.texi | 32 ++++++++++++++++----------------
 doc/emacs/display.texi | 14 +++++++-------
 doc/emacs/killing.texi | 14 +++++++-------
 etc/NEWS               |  6 +++++-
 lisp/bindings.el       |  4 ++++
 5 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 9cdfa49..3a166e4 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -232,9 +232,9 @@ unless they visit files: such buffers are used internally 
by Emacs.
 @table @kbd
 @item C-x C-q
 Toggle read-only status of buffer (@code{read-only-mode}).
-@item M-x rename-buffer @key{RET} @var{buffer} @key{RET}
+@item C-x x r @key{RET} @var{buffer} @key{RET}
 Change the name of the current buffer.
-@item M-x rename-uniquely
+@item C-x x u
 Rename the current buffer by adding @samp{<@var{number}>} to the end.
 @item M-x view-buffer @key{RET} @var{buffer} @key{RET}
 Scroll through buffer @var{buffer}.  @xref{View Mode}.
@@ -263,28 +263,28 @@ non-@code{nil} value, making the buffer read-only with 
@kbd{C-x C-q}
 also enables View mode in the buffer (@pxref{View Mode}).
 
 @findex rename-buffer
-  @kbd{M-x rename-buffer} changes the name of the current buffer.  You
-specify the new name as a minibuffer argument; there is no default.
-If you specify a name that is in use for some other buffer, an error
-happens and no renaming is done.
+  @kbd{C-x x r} (@code{rename-buffer} changes the name of the current
+buffer.  You specify the new name as a minibuffer argument; there is
+no default.  If you specify a name that is in use for some other
+buffer, an error happens and no renaming is done.
 
 @findex rename-uniquely
-  @kbd{M-x rename-uniquely} renames the current buffer to a similar
-name with a numeric suffix added to make it both different and unique.
-This command does not need an argument.  It is useful for creating
-multiple shell buffers: if you rename the @file{*shell*} buffer, then
-do @kbd{M-x shell} again, it makes a new shell buffer named
-@file{*shell*}; meanwhile, the old shell buffer continues to exist
-under its new name.  This method is also good for mail buffers,
+  @kbd{C-x x u} (@code{rename-uniquely}) renames the current buffer to
+a similar name with a numeric suffix added to make it both different
+and unique.  This command does not need an argument.  It is useful for
+creating multiple shell buffers: if you rename the @file{*shell*}
+buffer, then do @kbd{M-x shell} again, it makes a new shell buffer
+named @file{*shell*}; meanwhile, the old shell buffer continues to
+exist under its new name.  This method is also good for mail buffers,
 compilation buffers, and most Emacs features that create special
 buffers with particular names.  (With some of these features, such as
 @kbd{M-x compile}, @kbd{M-x grep}, you need to switch to some other
 buffer before using the command again, otherwise it will reuse the
 current buffer despite the name change.)
 
-  The commands @kbd{M-x append-to-buffer} and @kbd{M-x insert-buffer}
-can also be used to copy text from one buffer to another.
-@xref{Accumulating Text}.
+  The commands @kbd{M-x append-to-buffer} and @kbd{C-x x i}
+(@code{insert-buffer}) can also be used to copy text from one buffer
+to another.  @xref{Accumulating Text}.
 
 @node Kill Buffer
 @section Killing Buffers
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index f4b1854..2781328 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1755,13 +1755,13 @@ and/or leftmost columns.
 @findex toggle-truncate-lines
   Horizontal scrolling automatically causes line truncation
 (@pxref{Horizontal Scrolling}).  You can explicitly enable line
-truncation for a particular buffer with the command @kbd{M-x
-toggle-truncate-lines}.  This works by locally changing the variable
-@code{truncate-lines}.  If that variable is non-@code{nil}, long lines
-are truncated; if it is @code{nil}, they are continued onto multiple
-screen lines.  Setting the variable @code{truncate-lines} in any way
-makes it local to the current buffer; until that time, the default
-value, which is normally @code{nil}, is in effect.
+truncation for a particular buffer with the command @kbd{C-x x t}
+(@code{toggle-truncate-lines}).  This works by locally changing the
+variable @code{truncate-lines}.  If that variable is non-@code{nil},
+long lines are truncated; if it is @code{nil}, they are continued onto
+multiple screen lines.  Setting the variable @code{truncate-lines} in
+any way makes it local to the current buffer; until that time, the
+default value, which is normally @code{nil}, is in effect.
 
   If a split window becomes too narrow, Emacs may automatically enable
 line truncation.  @xref{Split Window}, for the variable
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 9bc786d..8434040 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -703,13 +703,13 @@ copy-to-buffer} is similar, except that any existing text 
in the other
 buffer is deleted, so the buffer is left containing just the text newly
 copied into it.
 
-  The command @kbd{M-x insert-buffer} can be used to retrieve the
-accumulated text from another buffer.  This prompts for the name of a
-buffer, and inserts a copy of all the text in that buffer into the
-current buffer at point, leaving point at the beginning of the
-inserted text.  It also adds the position of the end of the inserted
-text to the mark ring, without activating the mark.  @xref{Buffers},
-for background information on buffers.
+  The command @kbd{C-x x i} (@code{insert-buffer}) can be used to
+retrieve the accumulated text from another buffer.  This prompts for
+the name of a buffer, and inserts a copy of all the text in that
+buffer into the current buffer at point, leaving point at the
+beginning of the inserted text.  It also adds the position of the end
+of the inserted text to the mark ring, without activating the mark.
+@xref{Buffers}, for background information on buffers.
 
   Instead of accumulating text in a buffer, you can append text
 directly into a file with @kbd{M-x append-to-file}.  This prompts for
diff --git a/etc/NEWS b/etc/NEWS
index b80c649..0faed3e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -234,7 +234,11 @@ still applies for shorter search strings, which avoids 
flicker in the
 search buffer due to too many matches being highlighted.
 
 +++
-** 'revert-buffer' is now bound to 'C-x x g' globally.
+** A new keymap for buffer actions has been added.
+The 'C-x x' keymap now holds keystrokes for various buffer-oriented
+commands.  The new keystrokes are 'C-x x g' ('revert-buffer'),
+'C-x x r' ('rename-buffer'), 'C-x x u' ('rename-uniquely'),
+'C-x x i' ('insert-buffer') and 'C-x x t' ('toggle-truncate-lines').
 
 
 * Editing Changes in Emacs 28.1
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 35adfa8..9462468 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1416,6 +1416,10 @@ if `inhibit-field-text-motion' is non-nil."
 (defvar ctl-x-x-map
   (let ((map (make-sparse-keymap)))
     (define-key map "g" #'revert-buffer)
+    (define-key map "r" #'rename-buffer)
+    (define-key map "u" #'rename-uniquely)
+    (define-key map "i" #'insert-buffer)
+    (define-key map "t" #'toggle-truncate-lines)
     map)
   "Keymap for subcommands of C-x x.")
 (define-key ctl-x-map "x" ctl-x-x-map)



reply via email to

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