GNU bug report logs - #81758
31.1; ruby-base-mode-map should be the parent of ruby-ts-mode-map

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Cédric Delalande <cedric@HIDDEN>; dated Mon, 31 Aug 2026 08:19:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug reassigned from package 'ruby-ts-mode ' to 'emacs'. Request was from Michael Albinus <michael.albinus@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Aug 2026 08:18:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 31 04:18:25 2026
Received: from localhost ([127.0.0.1]:48877 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x0xDk-0006lJ-CU
	for submit <at> debbugs.gnu.org; Mon, 31 Aug 2026 04:18:25 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:51038)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <cedric@HIDDEN>)
 id 1x0vni-0007jh-VW
 for submit <at> debbugs.gnu.org; Mon, 31 Aug 2026 02:47:27 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <cedric@HIDDEN>)
 id 1x0vnd-0006sy-GI
 for bug-gnu-emacs@HIDDEN; Mon, 31 Aug 2026 02:47:21 -0400
Received: from 5.mo563.mail-out.ovh.net ([46.105.53.64])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <cedric@HIDDEN>)
 id 1x0vna-0006NL-8i
 for bug-gnu-emacs@HIDDEN; Mon, 31 Aug 2026 02:47:21 -0400
Received: from director6.derp.mail-out.ovh.net
 (director6.derp.mail-out.ovh.net [79.137.60.226])
 by mo563.mail-out.ovh.net (Postfix) with ESMTPS id 4hYKKh0hZ3z5vV9
 for <bug-gnu-emacs@HIDDEN>; Mon, 31 Aug 2026 06:47:04 +0000 (UTC)
Received: from director6.derp.mail-out.ovh.net
 (director6.derp.mail-out.ovh.net. [127.0.0.1])
 by director6.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP
 for <bug-gnu-emacs@HIDDEN>; Mon, 31 Aug 2026 06:47:04 +0000 (UTC)
Received: from mta2.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.168.168])
 by director6.derp.mail-out.ovh.net (Postfix) with ESMTPS id
 4hYKKg737Fz47q7
 for <bug-gnu-emacs@HIDDEN>; Mon, 31 Aug 2026 06:47:03 +0000 (UTC)
Received: from mailstore99.priv.ovhmail-u1.ea.mail.ovh.net (unknown
 [10.1.8.99])
 by mta2.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTP id CA2323E1B8C
 for <bug-gnu-emacs@HIDDEN>; Mon, 31 Aug 2026 06:47:03 +0000 (UTC)
Date: Mon, 31 Aug 2026 06:47:03 +0000 (UTC)
From: =?utf-8?Q?C=C3=A9dric?= Delalande <cedric@HIDDEN>
To: bug-gnu-emacs <bug-gnu-emacs@HIDDEN>
Message-ID: <510600531.158922885.1788158823697.JavaMail.zimbra@HIDDEN>
Subject: 31.1; ruby-base-mode-map should be the parent of ruby-ts-mode-map
MIME-Version: 1.0
Content-Type: multipart/alternative; 
 boundary="=_95be3583-6bfa-4ddc-b889-6ea374a79730"
X-Originating-IP: [91.174.88.39]
X-Authenticated-User: cedric@HIDDEN
Thread-Index: ZBpxnHZv+ShKk2GDy7yq1kxAlxt3FA==
Thread-Topic: 31.1; ruby-base-mode-map should be the parent of ruby-ts-mode-map
x-ovh-tracer-id: 2551007716852045166
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 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5L8vE3J2WeE0lLRRqasB30pDnZgggwdhtSyrZ47HfuieEUpu8wS8msWiD+V
 OT4o9m0PD2kPArT4lXDAd9uAC4wnUFdNL0pOzH4bEutNA==
Received-SPF: pass client-ip=46.105.53.64; envelope-from=cedric@HIDDEN;
 helo=5.mo563.mail-out.ovh.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 31 Aug 2026 04:18:22 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=_95be3583-6bfa-4ddc-b889-6ea374a79730
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=20
=20

Package: ruby-ts-mode=C2=A0
Version: Emacs 31.1 (also present in 30.x)=20
=C2=A0=20
I tracked down this bug when using Doom Emacs, but I think/wonder if it com=
es from Emacs. The maintainer updated the ruby module to have keymaps defin=
ed in ruby-base-mode-map, so they apply to both ruby-mode and ruby-ts-mode,=
 but these did not actually bubble up when activating ruby-ts-mode. So I lo=
oked closer.=20
=C2=A0=20
ruby-ts-mode-map is declared with :parent prog-mode-map, which overrides th=
e keymap inheritance that define-derived-mode ruby-ts-mode ruby-base-mode s=
hould establish. As a result, ruby-ts-mode does not use ruby-base-mode-map,=
 so keybindings added to ruby-base-mode-map have no effect in ruby-ts-mode =
buffers. I may be wrong, but I think this is not the intended behavior.=C2=
=A0=20
=C2=A0=20
This only matters from 30 onward where ruby-base-mode was introduced.=20
=C2=A0=20
Expected behavior=20
=C2=A0=20
Since ruby-base-mode exists precisely to share set-up between ruby-mode and=
 ruby-ts-mode, ruby-ts-mode-map's parent should be ruby-base-mode-map, so t=
hat bindings placed on ruby-base-mode-map apply in both modes.=20
=C2=A0=20
Running this command...=20
=C2=A0=20
emacs -Q --batch --eval '
(require (quote ruby-ts-mode))
(define-key ruby-base-mode-map (kbd "C-c @") (quote my-test-cmd))
(princ (format "base-map lookup: %S\n" (lookup-key ruby-base-mode-map (kbd =
"C-c @"))))
(princ (format "ts-map lookup: =C2=A0 =C2=A0%S\n" (lookup-key ruby-ts-mode-=
map (kbd "C-c @"))))
(princ (format "ts-map parent is base-map? %S\n" (eq (keymap-parent ruby-ts=
-mode-map) ruby-base-mode-map)))
(princ (format "ts-map parent: %S\n" (keymap-parent ruby-ts-mode-map)))
'=20
=C2=A0=20
...I get this output:
base-map lookup: my-test-cmd
ts-map lookup: =C2=A0 =C2=A0nil
ts-map parent is base-map? nil
ts-map parent: (keymap (27 keymap (113 . prog-fill-reindent-defun) (17 . pr=
og-indent-sexp)))


=20
I think this could be fixed in lisp/progmodes/ruby-ts-mode.el at line 1148:=
=20
=C2=A0=20
Current code:=20
=C2=A0 (defvar-keymap ruby-ts-mode-map
=C2=A0 :doc "Keymap used in Ruby mode"
=C2=A0 :parent prog-mode-map
=C2=A0 ;; (when ruby-use-smie
=C2=A0 ;; =C2=A0 (define-key map (kbd "M-C-d") 'smie-down-list))
=C2=A0 ;; (define-key map (kbd "M-C-p") 'ruby-beginning-of-block)
=C2=A0 ;; (define-key map (kbd "M-C-n") 'ruby-end-of-block)
=C2=A0 "C-c {" #'ruby-toggle-block
=C2=A0 "C-c '" #'ruby-toggle-string-quotes
=C2=A0 "C-c C-f" #'ruby-find-library-file)
=20

Proposed change: (defvar-keymap ruby-ts-mode-map
=C2=A0 :doc "Keymap used in Ruby mode"
=C2=A0 :parent ruby-base-mode-map=C2=A0 =C2=A0 =C2=A0 <-- HERE
=C2=A0 ;; (when ruby-use-smie
=C2=A0 ;; =C2=A0 (define-key map (kbd "M-C-d") 'smie-down-list))
=C2=A0 ;; (define-key map (kbd "M-C-p") 'ruby-beginning-of-block)
=C2=A0 ;; (define-key map (kbd "M-C-n") 'ruby-end-of-block)
=C2=A0 "C-c {" #'ruby-toggle-block
=C2=A0 "C-c '" #'ruby-toggle-string-quotes
=C2=A0 "C-c C-f" #'ruby-find-library-file)
=20
=C2=A0=20
I hope this is enough information for you to file and fix. Thanks for the h=
ard work on this amazing project.=20
=C2=A0=20
C=C3=A9dric Delalande =20
=20

--=_95be3583-6bfa-4ddc-b889-6ea374a79730
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"font-size: 12pt; font-family: arial, helvetica, s=
ans-serif; direction: null; color: #000000;" data-attr=3D"forced_root_block=
_attrs">
<div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs"><br>Package: ruby-ts-=
mode&nbsp;<br>Version: Emacs 31.1 (also present in 30.x)</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">I tracked down this b=
ug when using Doom Emacs, but I think/wonder if it comes from Emacs. The ma=
intainer updated the ruby module to have keymaps defined in ruby-base-mode-=
map, so they apply to both ruby-mode and ruby-ts-mode, but these did not ac=
tually bubble up when activating ruby-ts-mode. So I looked closer.</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">ruby-ts-mode-map is d=
eclared with :parent prog-mode-map, which overrides the keymap inheritance =
that define-derived-mode ruby-ts-mode ruby-base-mode should establish. As a=
 result, ruby-ts-mode does not use ruby-base-mode-map, so keybindings added=
 to ruby-base-mode-map have no effect in ruby-ts-mode buffers. I may be wro=
ng, but I think this is not the intended behavior.&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">This only matters fro=
m 30 onward where ruby-base-mode was introduced.</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">Expected behavior</di=
v>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">Since ruby-base-mode =
exists precisely to share set-up between ruby-mode and ruby-ts-mode, ruby-t=
s-mode-map's parent should be ruby-base-mode-map, so that bindings placed o=
n ruby-base-mode-map apply in both modes.</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">Running this command.=
..</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">emacs -Q --batch --ev=
al '<br>(require (quote ruby-ts-mode))<br>(define-key ruby-base-mode-map (k=
bd "C-c @") (quote my-test-cmd))<br>(princ (format "base-map lookup: %S\n" =
(lookup-key ruby-base-mode-map (kbd "C-c @"))))<br>(princ (format "ts-map l=
ookup: &nbsp; &nbsp;%S\n" (lookup-key ruby-ts-mode-map (kbd "C-c @"))))<br>=
(princ (format "ts-map parent is base-map? %S\n" (eq (keymap-parent ruby-ts=
-mode-map) ruby-base-mode-map)))<br>(princ (format "ts-map parent: %S\n" (k=
eymap-parent ruby-ts-mode-map)))<br>'</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">...I get this output:=
<br>base-map lookup: my-test-cmd<br>ts-map lookup: &nbsp; &nbsp;nil<br>ts-m=
ap parent is base-map? nil<br>ts-map parent: (keymap (27 keymap (113 . prog=
-fill-reindent-defun) (17 . prog-indent-sexp)))<br><br><br></div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">I think this could be=
 fixed in lisp/progmodes/ruby-ts-mode.el at line 1148:</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">Current code:</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
(defvar-keymap ruby-ts-mode-map<br>&nbsp; :doc "Keymap used in Ruby mode"<b=
r>&nbsp; :parent prog-mode-map<br>&nbsp; ;; (when ruby-use-smie<br>&nbsp; ;=
; &nbsp; (define-key map (kbd "M-C-d") 'smie-down-list))<br>&nbsp; ;; (defi=
ne-key map (kbd "M-C-p") 'ruby-beginning-of-block)<br>&nbsp; ;; (define-key=
 map (kbd "M-C-n") 'ruby-end-of-block)<br>&nbsp; "C-c {" #'ruby-toggle-bloc=
k<br>&nbsp; "C-c '" #'ruby-toggle-string-quotes<br>&nbsp; "C-c C-f" #'ruby-=
find-library-file)<br>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs"><br>Proposed change:<=
/div>
(defvar-keymap ruby-ts-mode-map<br>&nbsp; :doc "Keymap used in Ruby mode"<b=
r>&nbsp; :parent ruby-base-mode-map&nbsp; &nbsp; &nbsp; &lt;-- HERE<br>&nbs=
p; ;; (when ruby-use-smie<br>&nbsp; ;; &nbsp; (define-key map (kbd "M-C-d")=
 'smie-down-list))<br>&nbsp; ;; (define-key map (kbd "M-C-p") 'ruby-beginni=
ng-of-block)<br>&nbsp; ;; (define-key map (kbd "M-C-n") 'ruby-end-of-block)=
<br>&nbsp; "C-c {" #'ruby-toggle-block<br>&nbsp; "C-c '" #'ruby-toggle-stri=
ng-quotes<br>&nbsp; "C-c C-f" #'ruby-find-library-file)<br>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">I hope this is enough=
 information for you to file and fix. Thanks for the hard work on this amaz=
ing project.</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">&nbsp;</div>
<div style=3D"font-size: 12pt; font-family: arial, helvetica, sans-serif; c=
olor: #000000;" data-attr=3D"forced_root_block_attrs">C=C3=A9dric Delalande=
</div>
</div>
<div id=3D"signature-content-no-signature"></div>
</div></body></html>
--=_95be3583-6bfa-4ddc-b889-6ea374a79730--




Acknowledgement sent to Cédric Delalande <cedric@HIDDEN>:
New bug report received and forwarded. Copy sent to help-debbugs@HIDDEN.

Your message had a Version: pseudo-header with an invalid package version:

Emacs 31.1 (also present in 30.x)

please either use found or fixed to the control server with a correct version, or reply to this report indicating the correct version so the maintainer (or someone else) can correct it for you.

Full text available.


Report forwarded to help-debbugs@HIDDEN:
bug#81758; Package ruby-ts-mode . Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 31 Aug 2026 12:30:02 UTC

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