From: Juri Linkov Date: Sat, 19 Oct 2019 22:06:38 +0000 (+0300) Subject: Use 'C-x t' for tab-prefix-map instead of 'C-x 6' still used by 2C-mode-map. X-Git-Tag: emacs-27.0.90~977 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58d23f5f19b5b766fd70addcb36414a739a00e4a;p=emacs.git Use 'C-x t' for tab-prefix-map instead of 'C-x 6' still used by 2C-mode-map. * doc/emacs/commands.texi (Keys): Add 'C-x t'. * doc/emacs/frames.texi (Tab Bars): Replace 'C-x 6' with 'C-x t'. * doc/lispref/keymaps.texi (Prefix Keys): Add 'C-x t' (tab-prefix-map). * doc/lispref/maps.texi (Standard Keymaps): Add tab-prefix-map, tab-bar-map. * lisp/dired.el: Rebind 'C-x 6 d' to 'C-x t d'. Use tab-prefix-map. * lisp/subr.el (ctl-x-6-map, ctl-x-6-prefix, ctl-x-t-prefix): Remove. (tab-prefix-map): New keymap bound to 'C-x t'. * lisp/tab-bar.el: Use tab-prefix-map instead of ctl-x-6-map. * lisp/textmodes/two-column.el: Restore autoload global setting of "\C-x6" to 2C-command. * lisp/ldefs-boot.el: Update to add setting "\C-x6" to 2C-command. * doc/emacs/commands.texi (Keys): * doc/emacs/text.texi (Two-Column): * doc/lispref/keymaps.texi (Prefix Keys): * doc/lispref/maps.texi (Standard Keymaps): Restore 'C-x 6' bound to '2C-mode-map'. --- diff --git a/doc/emacs/commands.texi b/doc/emacs/commands.texi index 17e0d20f358..5eb3b304175 100644 --- a/doc/emacs/commands.texi +++ b/doc/emacs/commands.texi @@ -117,13 +117,14 @@ C-k} is two key sequences, not one. By default, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h}, @kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x -n}, @kbd{C-x r}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x 6}, -@key{ESC}, @kbd{M-g}, @kbd{M-o} and @key{F2}. (@key{F1} is an alias -for @kbd{C-h}.) This list is not cast in stone; if you customize -Emacs, you can make new prefix keys. You could even eliminate some of -the standard ones, though this is not recommended for most users; for -example, if you remove the prefix definition of @kbd{C-x 4}, then -@kbd{C-x 4 C-f} becomes an invalid key sequence. @xref{Key Bindings}. +n}, @kbd{C-x r}, @kbd{C-x t}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, +@kbd{C-x 6}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}. (@key{F1} and +@key{F2} are aliases for @kbd{C-h} and @kbd{C-x 6}.) This list is not +cast in stone; if you customize Emacs, you can make new prefix keys. +You could even eliminate some of the standard ones, though this is not +recommended for most users; for example, if you remove the prefix +definition of @kbd{C-x 4}, then @kbd{C-x 4 C-f} becomes an invalid key +sequence. @xref{Key Bindings}. Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key displays a list of the commands starting with that prefix. The sole diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 452c167c726..cac1f7fea6d 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1257,32 +1257,32 @@ use persistent named window configurations without using the tab bar by typing the related commands: @kbd{M-x tab-new}, @kbd{M-x tab-next}, @kbd{M-x tab-list}, @kbd{M-x tab-close}, etc. -@kindex C-x 6 - The prefix key @kbd{C-x 6} is analogous to @kbd{C-x 5}. +@kindex C-x t + The prefix key @kbd{C-x t} is analogous to @kbd{C-x 5}. Whereas each @kbd{C-x 5} command pops up a buffer in a different frame -(@pxref{Creating Frames}), the @kbd{C-x 6} commands use a different +(@pxref{Creating Frames}), the @kbd{C-x t} commands use a different tab with a different window configuration in the selected frame. - The various @kbd{C-x 6} commands differ in how they find or create the + The various @kbd{C-x t} commands differ in how they find or create the buffer to select: @table @kbd -@item C-x 6 2 -@kindex C-x 6 2 +@item C-x t 2 +@kindex C-x t 2 @findex tab-new Add a new tab (@code{tab-new}). You can control the choice of the buffer displayed in a new tab by customizing the variable @code{tab-bar-new-tab-choice}. -@item C-x 6 b @var{bufname} @key{RET} +@item C-x t b @var{bufname} @key{RET} Select buffer @var{bufname} in another tab. This runs @code{switch-to-buffer-other-tab}. -@item C-x 6 f @var{filename} @key{RET} +@item C-x t f @var{filename} @key{RET} Visit file @var{filename} and select its buffer in another tab. This runs @code{find-file-other-tab}. @xref{Visiting}. -@item C-x 6 d @var{directory} @key{RET} +@item C-x t d @var{directory} @key{RET} Select a Dired buffer for directory @var{directory} in another tab. This runs @code{dired-other-tab}. @xref{Dired}. -@item C-x 6 r @var{tabname} @key{RET} +@item C-x t r @var{tabname} @key{RET} Renames the current tab to @var{tabname}. You can control the programmatic name given to a tab by default by customizing the variable @code{tab-bar-tab-name-function}. @@ -1297,14 +1297,14 @@ new tab with other buffers, customize the variable The following commands are used to delete and operate on tabs: @table @kbd -@item C-x 6 0 -@kindex C-x 6 0 +@item C-x t 0 +@kindex C-x t 0 @findex tab-close Close the selected tab (@code{tab-close}). It has no effect if there is only one tab. -@item C-x 6 o -@kindex C-x 6 o +@item C-x t o +@kindex C-x t o @kindex C-TAB @findex tab-next Switch to another tab. If you repeat this command, it cycles through @@ -1312,8 +1312,8 @@ all the tabs on the selected frame. With a positive numeric argument N, it switches to the next Nth tab; with a negative argument −N, it switches back to the previous Nth tab. -@item C-x 6 1 -@kindex C-x 6 1 +@item C-x t 1 +@kindex C-x t 1 @findex tab-close-other Close all tabs on the selected frame, except the selected one. @end table diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index a837b6580dd..974f79d5232 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -2870,8 +2870,9 @@ of text. It uses two side-by-side windows, each showing its own buffer. There are three ways to enter two-column mode: @table @asis -@item @kbd{@key{F2} 2} +@item @kbd{@key{F2} 2} or @kbd{C-x 6 2} @kindex F2 2 +@kindex C-x 6 2 @findex 2C-two-columns Enter two-column mode with the current buffer on the left, and on the right, a buffer whose name is based on the current buffer's name @@ -2882,8 +2883,9 @@ changed. This command is appropriate when the current buffer is empty or contains just one column and you want to add another column. -@item @kbd{@key{F2} s} +@item @kbd{@key{F2} s} or @kbd{C-x 6 s} @kindex F2 s +@kindex C-x 6 s @findex 2C-split Split the current buffer, which contains two-column text, into two buffers, and display them side by side (@code{2C-split}). The current @@ -2896,19 +2898,21 @@ This command is appropriate when you have a buffer that already contains two-column text, and you wish to separate the columns temporarily. @item @kbd{@key{F2} b @var{buffer} @key{RET}} +@itemx @kbd{C-x 6 b @var{buffer} @key{RET}} @kindex F2 b +@kindex C-x 6 b @findex 2C-associate-buffer Enter two-column mode using the current buffer as the left-hand buffer, and using buffer @var{buffer} as the right-hand buffer (@code{2C-associate-buffer}). @end table - @kbd{@key{F2} s} looks for a column separator, which is a string -that appears on each line between the two columns. You can specify -the width of the separator with a numeric argument to @kbd{@key{F2} -s}; that many characters, before point, constitute the separator -string. By default, the width is 1, so the column separator is the -character before point. + @kbd{@key{F2} s} or @kbd{C-x 6 s} looks for a column separator, which +is a string that appears on each line between the two columns. You can +specify the width of the separator with a numeric argument to +@kbd{@key{F2} s}; that many characters, before point, constitute the +separator string. By default, the width is 1, so the column separator +is the character before point. When a line has the separator at the proper place, @kbd{@key{F2} s} puts the text after the separator into the right-hand buffer, and @@ -2920,22 +2924,25 @@ mode: write it in the left-hand buffer, and put an empty line in the right-hand buffer.) @kindex F2 RET +@kindex C-x 6 RET @findex 2C-newline - The command @kbd{@key{F2} @key{RET}} (@code{2C-newline}) inserts -a newline in each of the two buffers at corresponding positions. -This is the easiest way to add a new line to the two-column text while -editing it in split buffers. + The command @kbd{@key{F2} @key{RET}} or @kbd{C-x 6 @key{RET}} +(@code{2C-newline}) inserts a newline in each of the two buffers at +corresponding positions. This is the easiest way to add a new line to +the two-column text while editing it in split buffers. @kindex F2 1 +@kindex C-x 6 1 @findex 2C-merge When you have edited both buffers as you wish, merge them with -@kbd{@key{F2} 1} (@code{2C-merge}). This copies the +@kbd{@key{F2} 1} or @kbd{C-x 6 1} (@code{2C-merge}). This copies the text from the right-hand buffer as a second column in the other buffer. To go back to two-column editing, use @kbd{@key{F2} s}. @kindex F2 d +@kindex C-x 6 d @findex 2C-dissociate - Use @kbd{@key{F2} d} to dissociate the two buffers, leaving each as -it stands (@code{2C-dissociate}). If the other buffer, the one not -current when you type @kbd{@key{F2} d}, is empty, @kbd{@key{F2} d} -kills it. + Use @kbd{@key{F2} d} or @kbd{C-x 6 d} to dissociate the two buffers, +leaving each as it stands (@code{2C-dissociate}). If the other buffer, +the one not current when you type @kbd{@key{F2} d}, is empty, +@kbd{@key{F2} d} kills it. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 532e537026a..8ff329bdacb 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -545,8 +545,14 @@ key. @item @cindex @kbd{C-x 6} -@vindex ctl-x-6-map -@code{ctl-x-6-map} is the global keymap used for the @kbd{C-x 6} prefix +@vindex 2C-mode-map +@code{2C-mode-map} is the global keymap used for the @kbd{C-x 6} prefix +key. + +@item +@cindex @kbd{C-x t} +@vindex tab-prefix-map +@code{tab-prefix-map} is the global keymap used for the @kbd{C-x t} prefix key. @item diff --git a/doc/lispref/maps.texi b/doc/lispref/maps.texi index 1ee4816b0c7..7743f3cb3c4 100644 --- a/doc/lispref/maps.texi +++ b/doc/lispref/maps.texi @@ -21,7 +21,7 @@ keymaps, @pxref{Keymaps}. @c Don't add xrefs to things covered in {Keymaps}. @table @code @item 2C-mode-map -A sparse keymap for subcommands of the prefix @key{F2}.@* +A sparse keymap for subcommands of the prefix @kbd{C-x 6}.@* @xref{Two-Column,, Two-Column Editing, emacs, The GNU Emacs Manual}. @item abbrev-map @@ -42,9 +42,6 @@ A sparse keymap for subcommands of the prefix @kbd{C-x 4}. @item ctl-x-5-map A sparse keymap for subcommands of the prefix @kbd{C-x 5}. -@item ctl-x-6-map -A sparse keymap for subcommands of the prefix @kbd{C-x 6}. - @item ctl-x-map A full keymap for @kbd{C-x} commands. @@ -181,6 +178,14 @@ A sparse keymap that provides global bindings for search-related commands. The keymap used by Special mode.@* @xref{Basic Major Modes}. +@item tab-prefix-map +The global keymap used for the @kbd{C-x t} prefix key for tab-bar related commands.@* +@xref{Tab Bars,,, emacs, The GNU Emacs Manual}. + +@item tab-bar-map +The keymap defining the contents of the tab bar.@* +@xref{Tab Bars,,, emacs, The GNU Emacs Manual}. + @item tool-bar-map The keymap defining the contents of the tool bar.@* @xref{Tool Bar}. diff --git a/etc/NEWS b/etc/NEWS index 6ed3fd46085..e49dc0c9982 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2131,9 +2131,9 @@ The new command 'tab-bar-mode' enables the tab bar at the top of each frame, where you can use tabs to switch between named persistent window configurations. -The 'C-x 6' sequence is the new prefix key for tab-related commands: -'C-x 6 2' creates a new tab; 'C-x 6 0' deletes the current tab; -'C-x 6 b' switches to buffer in another tab; 'C-x 6 f' and 'C-x 6 C-f' +The 'C-x t' sequence is the new prefix key for tab-related commands: +'C-x t 2' creates a new tab; 'C-x t 0' deletes the current tab; +'C-x t b' switches to buffer in another tab; 'C-x t f' and 'C-x t C-f' edit file in another tab; and 'C-TAB' and 'S-C-TAB' switch to the next or previous tab. You can also switch between tabs and create/delete tabs with a mouse. @@ -2195,11 +2195,6 @@ immediately. Type 'M-x so-long-commentary' for full documentation. * Incompatible Lisp Changes in Emacs 27.1 ---- -** Two-column mode provides its 'C-x 6' prefix map only after loading -two-column.el. Its prefix key 'F2' is still available globally -along with 'C-x 6' used by the tab commands globally. - --- ** Incomplete destructive splicing support has been removed. Support for Common Lisp style destructive splicing (",.") was diff --git a/lisp/dired.el b/lisp/dired.el index 574de7ac3eb..3146511305d 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -848,7 +848,7 @@ If DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "in other frame ")) (switch-to-buffer-other-frame (dired-noselect dirname switches))) -;;;###autoload (define-key ctl-x-6-map "d" 'dired-other-tab) +;;;###autoload (define-key tab-prefix-map "d" 'dired-other-tab) ;;;###autoload (defun dired-other-tab (dirname &optional switches) "\"Edit\" directory DIRNAME. Like `dired' but makes a new tab." diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 5c20c0526d4..ea111f2d3f1 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -34138,6 +34138,7 @@ resumed later. ;;;;;; 0 0)) ;;; Generated autoloads from textmodes/two-column.el (autoload '2C-command "two-column" () t 'keymap) + (global-set-key "\C-x6" '2C-command) (global-set-key [f2] '2C-command) (autoload '2C-two-columns "two-column" "\ diff --git a/lisp/subr.el b/lisp/subr.el index f3371dd2d74..ada078aed9b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1262,12 +1262,9 @@ The normal global definition of the character C-x indirects to this keymap.") (defalias 'ctl-x-5-prefix ctl-x-5-map) (define-key ctl-x-map "5" 'ctl-x-5-prefix) -(defvar ctl-x-6-map (make-sparse-keymap) - "Keymap for tab commands.") -(defalias 'ctl-x-6-prefix ctl-x-6-map) -(define-key ctl-x-map "6" 'ctl-x-6-prefix) -(defalias 'ctl-x-t-prefix ctl-x-6-map) -(define-key ctl-x-map "t" 'ctl-x-t-prefix) +(defvar tab-prefix-map (make-sparse-keymap) + "Keymap for tab-bar related commands.") +(define-key ctl-x-map "t" tab-prefix-map) ;;;; Event manipulation functions. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index c376f598966..52d06872312 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -962,14 +962,14 @@ Like \\[find-file-other-frame] (which see), but creates a new tab." value) (switch-to-buffer-other-tab value)))) -(define-key ctl-x-6-map "2" 'tab-new) -(define-key ctl-x-6-map "1" 'tab-close-other) -(define-key ctl-x-6-map "0" 'tab-close) -(define-key ctl-x-6-map "o" 'tab-next) -(define-key ctl-x-6-map "b" 'switch-to-buffer-other-tab) -(define-key ctl-x-6-map "f" 'find-file-other-tab) -(define-key ctl-x-6-map "\C-f" 'find-file-other-tab) -(define-key ctl-x-6-map "r" 'tab-rename) +(define-key tab-prefix-map "2" 'tab-new) +(define-key tab-prefix-map "1" 'tab-close-other) +(define-key tab-prefix-map "0" 'tab-close) +(define-key tab-prefix-map "o" 'tab-next) +(define-key tab-prefix-map "b" 'switch-to-buffer-other-tab) +(define-key tab-prefix-map "f" 'find-file-other-tab) +(define-key tab-prefix-map "\C-f" 'find-file-other-tab) +(define-key tab-prefix-map "r" 'tab-rename) (provide 'tab-bar) diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 5bc70d0bd5f..e1ebf1a02a0 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -184,9 +184,7 @@ minus this value." ;; This one is for historical reasons and simple keyboards, it is not ;; at all mnemonic. All usual sequences containing 2 were used, and ;; f2 could not be set up in a standard way under Emacs 18. -;; This prefix is bound only after loading this package -;; to not conflict with the C-x 6 prefix used by tab commands. -(global-set-key "\C-x6" '2C-command) +;;;###autoload (global-set-key "\C-x6" '2C-command) ;;;###autoload (global-set-key [f2] '2C-command)