GNU bug report logs - #79323
30.2; Control-X-prefix not remapable

Previous Next

Package: emacs;

Reported by: Linn Stanton <linnstanton <at> me.com>

Date: Wed, 27 Aug 2025 17:23:02 UTC

Severity: normal

Found in version 30.2

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

To reply to this bug, email your comments to 79323 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Wed, 27 Aug 2025 17:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Linn Stanton <linnstanton <at> me.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 27 Aug 2025 17:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Linn Stanton <linnstanton <at> me.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Linn Stanton <linnstanton <at> me.com>
Subject: 30.2; Control-X-prefix not remapable
Date: Wed, 27 Aug 2025 13:01:36 -0400
[Message part 1 (text/plain, inline)]
Y

Updating from emacs-29 to emacs-30, I am no longer able to use C-x as a
non-prefix key. I have always hated the C-x prefix, as I use C-x for
next-line. I am still able to set C-] as my Control-X-prefix, but I can
no longer get C-x mapped to 'next-line. I had been using define-key with
a custom overriding-local-map, but that is no longer working


In GNU Emacs 30.2 (build 1, aarch64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.6.1 (Build 21G217)) of 2025-08-14 built on
builder-m1-12.lan
Windowing system distributor 'Apple', version 10.3.2685
System Description:  macOS 26.0

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000
-DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no'

Configured features:
ACL GLIB GMP GNUTLS JPEG LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
  global-tab-line-mode: t
  tab-line-mode: t
  which-function-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  isearch-fold-quotes-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils jka-compr info shortdoc text-property-search
comp-common rx noutline outline two-column kmacro facemenu help-fns
radix-tree apropos add-log cl-extra help-mode time-date tab-line
cus-load which-func imenu ispell desktop frameset package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs icons password-cache json
subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 124293 14842) (symbols 48 22924 4) (strings 32 46142 1443)
(string-bytes 1 1005039) (vectors 16 20113)
(vector-slots 8 476524 48761) (floats 8 121 98)
(intervals 56 8703 96) (buffers 992 17))


L i n n   S t a n t o n
linnstanton <at> mac.com  
(917) 208-8246

"The more corrupt the state, the more numerous the laws" -- Tacitus




[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Wed, 27 Aug 2025 19:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Linn Stanton <linnstanton <at> me.com>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Wed, 27 Aug 2025 22:15:02 +0300
> Cc: Linn Stanton <linnstanton <at> me.com>
> Date: Wed, 27 Aug 2025 13:01:36 -0400
> From:  Linn Stanton via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Updating from emacs-29 to emacs-30, I am no longer able to use C-x as a
> non-prefix key. I have always hated the C-x prefix, as I use C-x for
> next-line. I am still able to set C-] as my Control-X-prefix, but I can
> no longer get C-x mapped to 'next-line. I had been using define-key with
> a custom overriding-local-map, but that is no longer working

Please show the code that worked for you in Emacs 29, but does not
work in Emacs 30.2.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 14:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Linn Stanton <linnstanton <at> me.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 17:22:05 +0300
> From: Linn Stanton <linnstanton <at> me.com>
> Date: Thu, 28 Aug 2025 09:47:22 -0400
> Cc: Linn Stanton <linnstanton <at> me.com>,
>  79323 <at> debbugs.gnu.org
> 
> Here is the relevant portion of my .emacs:
> 
> (make-local-variable 'overriding-local-map)
> (setq overriding-local-map (copy-keymap global-map))
> (define-key global-map [(control ?\])] 'Control-X-prefix)
> (global-set-key [(control x)] 'next-line)
> (define-key global-map [(control x)] 'next-line)
> (define-key overriding-local-map [(control x)] 'next-line)
> (define-key minibuffer-local-map  [(control e)] 'previous-history-element)
> (define-key minibuffer-local-map  [(control x)] 'next-history-element)
> (define-key minibuffer-local-completion-map [(control e)] 'previous-history-element)
> (define-key minibuffer-local-completion-map [(control x)] 'next-history-element)
> (define-key minibuffer-local-isearch-map [(control e)] 'previous-history-element)
> 
> Up until recently, this let me remap C-x to next-line, with all the standard C-x functionality moving to C-], but
> in the current version while the C-] mapping still works, C-x is still interpreted as a prefix

I cannot quite reproduce this, so maybe something is missing from the
above recipe.

If I start "emacs -Q" and then evaluate this:

  (make-local-variable 'overriding-local-map)
  (setq overriding-local-map (copy-keymap global-map))
  (define-key global-map [(control ?\])] 'Control-X-prefix)
  (global-set-key [(control x)] 'next-line)
  (define-key global-map [(control x)] 'next-line)
  (define-key overriding-local-map [(control x)] 'next-line)

then C-x becomes bound to next-line both in Emacs 29 and in Emacs 30.
C-] doesn't get bound to C-x prefix, but that doesn't happen in Emacs
29, either.

Stefan, did we change anything in Emacs 30 that should affect the
above?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 15:54:02 GMT) Full text and rfc822 format available.

Message #14 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Linn Stanton <linnstanton <at> me.com>
Cc: 79323 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 18:52:51 +0300
> From: Linn Stanton <linnstanton <at> me.com>
> Date: Thu, 28 Aug 2025 10:35:39 -0400
> Cc: Linn Stanton <linnstanton <at> me.com>,
>  Stefan Monnier <monnier <at> iro.umontreal.ca>,
>  79323 <at> debbugs.gnu.org
> 
> I am attaching my entire .emacs, but it does seem odd
> 
> In the current 30.2, with just the code fragment, it seems the C-] assignment has to go into overriding-local-map

Maybe this is something specific to macOS?  Can anyone else reproduce
this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 15:54:03 GMT) Full text and rfc822 format available.

Message #17 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Linn Stanton <linnstanton <at> me.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Linn Stanton <linnstanton <at> me.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 10:53:27 -0400
[Message part 1 (text/plain, inline)]
As an update, I am attaching my current .emacs.  Interestingly, it does not set C-x for the entire session, but if I eval-region on the overriding-local-map chunk, then it takes. Is the overriding-local-map so local that it won’t work in .emacs?


L i n n   S t a n t o n
linnstanton <at> mac.com  
(917) 208-8246

In any moment of decision, the best thing you can do is the right thing, the next best thing is the wrong thing, and the worst thing you can do is nothing.

Theodore Roosevelt <http://www.brainyquote.com/quotes/authors/t/theodore_roosevelt.html>

> On Aug 28, 2025, at 10:35 AM, Linn Stanton <linnstanton <at> me.com> wrote:
> 
> I am attaching my entire .emacs, but it does seem odd
> 
> In the current 30.2, with just the code fragment, it seems the C-] assignment has to go into overriding-local-map
> 
> <.emacs copy>
> 
> L i n n   S t a n t o n
> linnstanton <at> mac.com  
> (917) 208-8246
> 
> 
> Do what you can, with what you have, where you are.
> 
> Theodore Roosevelt <http://www.brainyquote.com/quotes/authors/t/theodore_roosevelt.html>
> 
> 
> 
> 
>> On Aug 28, 2025, at 10:22 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> 
>>> From: Linn Stanton <linnstanton <at> me.com <mailto:linnstanton <at> me.com>>
>>> Date: Thu, 28 Aug 2025 09:47:22 -0400
>>> Cc: Linn Stanton <linnstanton <at> me.com <mailto:linnstanton <at> me.com>>,
>>> 79323 <at> debbugs.gnu.org <mailto:79323 <at> debbugs.gnu.org>
>>> 
>>> Here is the relevant portion of my .emacs:
>>> 
>>> (make-local-variable 'overriding-local-map)
>>> (setq overriding-local-map (copy-keymap global-map))
>>> (define-key global-map [(control ?\])] 'Control-X-prefix)
>>> (global-set-key [(control x)] 'next-line)
>>> (define-key global-map [(control x)] 'next-line)
>>> (define-key overriding-local-map [(control x)] 'next-line)
>>> (define-key minibuffer-local-map  [(control e)] 'previous-history-element)
>>> (define-key minibuffer-local-map  [(control x)] 'next-history-element)
>>> (define-key minibuffer-local-completion-map [(control e)] 'previous-history-element)
>>> (define-key minibuffer-local-completion-map [(control x)] 'next-history-element)
>>> (define-key minibuffer-local-isearch-map [(control e)] 'previous-history-element)
>>> 
>>> Up until recently, this let me remap C-x to next-line, with all the standard C-x functionality moving to C-], but
>>> in the current version while the C-] mapping still works, C-x is still interpreted as a prefix
>> 
>> I cannot quite reproduce this, so maybe something is missing from the
>> above recipe.
>> 
>> If I start "emacs -Q" and then evaluate this:
>> 
>>  (make-local-variable 'overriding-local-map)
>>  (setq overriding-local-map (copy-keymap global-map))
>>  (define-key global-map [(control ?\])] 'Control-X-prefix)
>>  (global-set-key [(control x)] 'next-line)
>>  (define-key global-map [(control x)] 'next-line)
>>  (define-key overriding-local-map [(control x)] 'next-line)
>> 
>> then C-x becomes bound to next-line both in Emacs 29 and in Emacs 30.
>> C-] doesn't get bound to C-x prefix, but that doesn't happen in Emacs
>> 29, either.
>> 
>> Stefan, did we change anything in Emacs 30 that should affect the
>> above?
> 

[Message part 2 (text/html, inline)]
[.emacs (application/octet-stream, attachment)]
[Message part 4 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 17:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Scott Bell <sctb <at> me.com>
To: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 11:51:15 -0600
> As an update, I am attaching my current .emacs.  Interestingly, it
> does not set C-x for the entire session, but if I eval-region on the
> overriding-local-map chunk, then it takes. Is the overriding-local-map
> so local that it won’t work in .emacs?

I was able to reproduce the issue as described on macOS with the .emacs
provided, and reduced it to the minimum as follows:

(define-key global-map [(control ?\])] 'Control-X-prefix)
(make-local-variable 'overriding-local-map)
(setq overriding-local-map (copy-keymap global-map))
(define-key overriding-local-map [(control ?\])] 'Control-X-prefix)
(global-set-key [(control x)] 'next-line)
(define-key global-map [(control x)] 'next-line)
(define-key overriding-local-map [(control x)] 'next-line)

(custom-set-variables
 '(global-tab-line-mode t))

The culprit here is global-tab-line-mode.

Commit 230eecf12a introduces C-x prefixed bindings for tab switching,
which are present in 30.2 but not 29.4.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 18:00:02 GMT) Full text and rfc822 format available.

Message #23 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Stéphane Marks <shipmints <at> gmail.com>
To: Scott Bell <sctb <at> me.com>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 13:58:33 -0400
[Message part 1 (text/plain, inline)]
On Thu, Aug 28, 2025 at 1:56 PM Scott Bell via Bug reports for GNU Emacs,
the Swiss army knife of text editors <bug-gnu-emacs <at> gnu.org> wrote:

> > As an update, I am attaching my current .emacs.  Interestingly, it
> > does not set C-x for the entire session, but if I eval-region on the
> > overriding-local-map chunk, then it takes. Is the overriding-local-map
> > so local that it won’t work in .emacs?
>
> I was able to reproduce the issue as described on macOS with the .emacs
> provided, and reduced it to the minimum as follows:
>
> (define-key global-map [(control ?\])] 'Control-X-prefix)
> (make-local-variable 'overriding-local-map)
> (setq overriding-local-map (copy-keymap global-map))
> (define-key overriding-local-map [(control ?\])] 'Control-X-prefix)
> (global-set-key [(control x)] 'next-line)
> (define-key global-map [(control x)] 'next-line)
> (define-key overriding-local-map [(control x)] 'next-line)
>
> (custom-set-variables
>  '(global-tab-line-mode t))
>
> The culprit here is global-tab-line-mode.
>
> Commit 230eecf12a introduces C-x prefixed bindings for tab switching,
> which are present in 30.2 but not 29.4.
>

If I were a `tab-line` user, I suppose we would have done the same there as
we did in `tab-bar.  See master `tab-bar-define-keys` which I bind to nil
as I manage my own bindings.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 18:58:02 GMT) Full text and rfc822 format available.

Message #26 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Scott Bell <sctb <at> me.com>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 21:56:01 +0300
> The culprit here is global-tab-line-mode.
>
> Commit 230eecf12a introduces C-x prefixed bindings for tab switching,
> which are present in 30.2 but not 29.4.

Thanks for finding this commit.  I forgot we have a special keymap
'ctl-x-map'.  This patch should fix it:

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 7caae8bc2c1..17015ffcbb5 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -1279,12 +1279,13 @@ tab-line-event-start
 
 (defvar-keymap tab-line-mode-map
   :doc "Keymap for keys of `tab-line-mode'."
-  "C-x <left>"    #'tab-line-switch-to-prev-tab
-  "C-x C-<left>"  #'tab-line-switch-to-prev-tab
-  "C-x M-<left>"  #'tab-line-move-tab-backward
-  "C-x <right>"   #'tab-line-switch-to-next-tab
-  "C-x C-<right>" #'tab-line-switch-to-next-tab
-  "C-x M-<right>" #'tab-line-move-tab-forward)
+  :parent ctl-x-map
+  "<left>"    #'tab-line-switch-to-prev-tab
+  "C-<left>"  #'tab-line-switch-to-prev-tab
+  "M-<left>"  #'tab-line-move-tab-backward
+  "<right>"   #'tab-line-switch-to-next-tab
+  "C-<right>" #'tab-line-switch-to-next-tab
+  "M-<right>" #'tab-line-move-tab-forward)
 
 (defvar-keymap tab-line-switch-repeat-map
   :doc "Keymap to repeat tab/buffer cycling.  Used in `repeat-mode'."





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 19:09:02 GMT) Full text and rfc822 format available.

Message #29 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Scott Bell <sctb <at> me.com>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 22:07:20 +0300
>  (defvar-keymap tab-line-mode-map
>    :doc "Keymap for keys of `tab-line-mode'."
> +  :parent ctl-x-map
> +  "<left>"    #'tab-line-switch-to-prev-tab
> +  "C-<left>"  #'tab-line-switch-to-prev-tab
> +  "M-<left>"  #'tab-line-move-tab-backward
> +  "<right>"   #'tab-line-switch-to-next-tab
> +  "C-<right>" #'tab-line-switch-to-next-tab
> +  "M-<right>" #'tab-line-move-tab-forward)

Actually, this doesn't work.  And this doesn't work too:

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 7caae8bc2c1..b9eb3b967c7 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -1279,12 +1279,13 @@ tab-line-event-start
 
 (defvar-keymap tab-line-mode-map
   :doc "Keymap for keys of `tab-line-mode'."
-  "C-x <left>"    #'tab-line-switch-to-prev-tab
-  "C-x C-<left>"  #'tab-line-switch-to-prev-tab
-  "C-x M-<left>"  #'tab-line-move-tab-backward
-  "C-x <right>"   #'tab-line-switch-to-next-tab
-  "C-x C-<right>" #'tab-line-switch-to-next-tab
-  "C-x M-<right>" #'tab-line-move-tab-forward)
+  :prefix 'ctl-x-map
+  "<left>"    #'tab-line-switch-to-prev-tab
+  "C-<left>"  #'tab-line-switch-to-prev-tab
+  "M-<left>"  #'tab-line-move-tab-backward
+  "<right>"   #'tab-line-switch-to-next-tab
+  "C-<right>" #'tab-line-switch-to-next-tab
+  "M-<right>" #'tab-line-move-tab-forward)

Probably there is no way to do this with 'defvar-keymap'?
This leaves only one solution with

  (define-key ctl-x-map ...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Thu, 28 Aug 2025 19:18:04 GMT) Full text and rfc822 format available.

Message #32 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Scott Bell <sctb <at> me.com>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Thu, 28 Aug 2025 22:13:30 +0300
> Probably there is no way to do this with 'defvar-keymap'?
> This leaves only one solution with
>
>   (define-key ctl-x-map ...

I meant this patch:

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 7caae8bc2c1..b1f097effd4 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -1277,14 +1277,12 @@ tab-line-event-start
-(defvar-keymap tab-line-mode-map
-  :doc "Keymap for keys of `tab-line-mode'."
-  "C-x <left>"    #'tab-line-switch-to-prev-tab
-  "C-x C-<left>"  #'tab-line-switch-to-prev-tab
-  "C-x M-<left>"  #'tab-line-move-tab-backward
-  "C-x <right>"   #'tab-line-switch-to-next-tab
-  "C-x C-<right>" #'tab-line-switch-to-next-tab
-  "C-x M-<right>" #'tab-line-move-tab-forward)
+(define-key ctl-x-map [left] #'tab-line-switch-to-prev-tab)
+(define-key ctl-x-map [C-left] #'tab-line-switch-to-prev-tab)
+(define-key ctl-x-map [M-left] #'tab-line-move-tab-backward)
+(define-key ctl-x-map [right] #'tab-line-switch-to-next-tab)
+(define-key ctl-x-map [C-right] #'tab-line-switch-to-next-tab)
+(define-key ctl-x-map [M-right] #'tab-line-move-tab-forward)

But this will throw away all user keys customized
in 'tab-line-mode-map' :-(




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Fri, 29 Aug 2025 07:09:02 GMT) Full text and rfc822 format available.

Message #35 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stéphane Marks <shipmints <at> gmail.com>
Cc: Scott Bell <sctb <at> me.com>, 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Fri, 29 Aug 2025 09:57:17 +0300
[Message part 1 (text/plain, inline)]
> If I were a `tab-line` user, I suppose we would have done the same there as
> we did in `tab-bar.  See master `tab-bar-define-keys` which I bind to nil
> as I manage my own bindings.

Thanks for the good idea, this should work:

[tab-line-define-keys.patch (text/x-diff, inline)]
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 7caae8bc2c1..aba88d8e8f5 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -1277,14 +1277,48 @@ tab-line-event-start
       (event-start event)))
 
 
+(defcustom tab-line-define-keys t
+  "Define specific tab-line key bindings.
+If t, the default, key mappings for switching and moving tabs
+are defined.  If nil, do not define any key mappings."
+  :type 'boolean
+  :initialize #'custom-initialize-default
+  :set (lambda (sym val)
+         (tab-line--undefine-keys)
+         (set-default sym val)
+         ;; Enable the new keybindings
+         (tab-line--define-keys))
+  :group 'tab-line
+  :version "31.1")
+
+(defun tab-line--define-keys ()
+  "Install key bindings to switch between tabs if so configured."
+  (when tab-line-define-keys
+    (when (eq (lookup-key ctl-x-map [left]) 'previous-buffer)
+      (define-key ctl-x-map [left] 'tab-line-switch-to-prev-tab))
+    (when (eq (lookup-key ctl-x-map [C-left]) 'previous-buffer)
+      (define-key ctl-x-map [C-left] 'tab-line-switch-to-prev-tab))
+    (unless (lookup-key ctl-x-map [M-left])
+      (define-key ctl-x-map [M-left] 'tab-line-move-tab-backward))
+    (when (eq (lookup-key ctl-x-map [right]) 'next-buffer)
+      (define-key ctl-x-map [right] 'tab-line-switch-to-next-tab))
+    (when (eq (lookup-key ctl-x-map [C-right]) 'next-buffer)
+      (define-key ctl-x-map [C-right] 'tab-line-switch-to-next-tab))
+    (unless (lookup-key ctl-x-map [M-right])
+      (define-key ctl-x-map [M-right] 'tab-line-move-tab-forward))))
+
+(defun tab-line--undefine-keys ()
+  "Uninstall key bindings previously bound by `tab-line--define-keys'."
+  (when tab-line-define-keys
+    (define-key ctl-x-map [left] 'previous-buffer)
+    (define-key ctl-x-map [C-left] 'previous-buffer)
+    (define-key ctl-x-map [M-left] nil)
+    (define-key ctl-x-map [right] 'next-buffer)
+    (define-key ctl-x-map [C-right] 'next-buffer)
+    (define-key ctl-x-map [M-right] 'next-buffer)))
+
 (defvar-keymap tab-line-mode-map
-  :doc "Keymap for keys of `tab-line-mode'."
-  "C-x <left>"    #'tab-line-switch-to-prev-tab
-  "C-x C-<left>"  #'tab-line-switch-to-prev-tab
-  "C-x M-<left>"  #'tab-line-move-tab-backward
-  "C-x <right>"   #'tab-line-switch-to-next-tab
-  "C-x C-<right>" #'tab-line-switch-to-next-tab
-  "C-x M-<right>" #'tab-line-move-tab-forward)
+  :doc "Keymap for keys of `tab-line-mode'.")
 
 (defvar-keymap tab-line-switch-repeat-map
   :doc "Keymap to repeat tab/buffer cycling.  Used in `repeat-mode'."
@@ -1374,7 +1408,10 @@ tab-line-mode--turn-on
 (define-globalized-minor-mode global-tab-line-mode
   tab-line-mode tab-line-mode--turn-on
   :group 'tab-line
-  :version "27.1")
+  :version "27.1"
+  (if tab-line-mode
+      (tab-line--define-keys)
+    (tab-line--undefine-keys)))
 
 
 (global-set-key [tab-line down-mouse-3] 'tab-line-context-menu)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Fri, 29 Aug 2025 14:49:02 GMT) Full text and rfc822 format available.

Message #38 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Linn Stanton <linnstanton <at> me.com>, 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Fri, 29 Aug 2025 10:48:26 -0400
>> Here is the relevant portion of my .emacs:
>> 
>> (make-local-variable 'overriding-local-map)

That doesn't make sense: the buffer that's current while reading `.emacs`
is probably not the one for which you want to set
`overriding-local-map`.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Sun, 31 Aug 2025 03:51:01 GMT) Full text and rfc822 format available.

Message #41 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Howard Melman <hmelman <at> gmail.com>
To: juri <at> linkov.net
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Sat, 30 Aug 2025 23:50:27 -0400
Juri Linkov <juri <at> linkov.net> writes:

> +(defun tab-line--undefine-keys ()
> +  "Uninstall key bindings previously bound by `tab-line--define-keys'."
> +  (when tab-line-define-keys
> +    (define-key ctl-x-map [left] 'previous-buffer)
> +    (define-key ctl-x-map [C-left] 'previous-buffer)
> +    (define-key ctl-x-map [M-left] nil)
> +    (define-key ctl-x-map [right] 'next-buffer)
> +    (define-key ctl-x-map [C-right] 'next-buffer)
> +    (define-key ctl-x-map [M-right] 'next-buffer)))

I didn't check this, but could you do this instead? 
(I use this form of define-keymap in other cases.)

(defun tab-line--undefine-keys ()
  "Uninstall key bindings previously bound by `tab-line--define-keys'."
  (when tab-line-define-keys
    (define-keymap :keymap ctl-x-map
      [left] 'previous-buffer
      [C-left] 'previous-buffer
      [M-left] nil
      [right] 'next-buffer
      [C-right] 'next-buffer
      [M-right] 'next-buffer)))

-- 

Howard




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Sun, 31 Aug 2025 03:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Sun, 31 Aug 2025 18:29:01 GMT) Full text and rfc822 format available.

Message #47 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Howard Melman <hmelman <at> gmail.com>
Cc: 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Sun, 31 Aug 2025 21:01:33 +0300
> I didn't check this, but could you do this instead? 
> (I use this form of define-keymap in other cases.)
>
> (defun tab-line--undefine-keys ()
>   "Uninstall key bindings previously bound by `tab-line--define-keys'."
>   (when tab-line-define-keys
>     (define-keymap :keymap ctl-x-map
>       [left] 'previous-buffer
>       [C-left] 'previous-buffer
>       [M-left] nil
>       [right] 'next-buffer
>       [C-right] 'next-buffer
>       [M-right] 'next-buffer)))

I tried :parent and :prefix without success, but completely
missed :keymap.  Thanks for pointing out the correct keyword.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79323; Package emacs. (Sun, 31 Aug 2025 18:29:02 GMT) Full text and rfc822 format available.

Message #50 received at 79323 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stéphane Marks <shipmints <at> gmail.com>
Cc: Scott Bell <sctb <at> me.com>, 79323 <at> debbugs.gnu.org
Subject: Re: bug#79323: 30.2; Control-X-prefix not remapable
Date: Sun, 31 Aug 2025 21:23:58 +0300
close 79323 31.0.50
thanks

>> If I were a `tab-line` user, I suppose we would have done the same there as
>> we did in `tab-bar.  See master `tab-bar-define-keys` which I bind to nil
>> as I manage my own bindings.
>
> Thanks for the good idea, this should work:
>
> +(defcustom tab-line-define-keys t

So this is pushed now and closed.




bug marked as fixed in version 31.0.50, send any further explanations to 79323 <at> debbugs.gnu.org and Linn Stanton <linnstanton <at> me.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Sun, 31 Aug 2025 18:29:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.