GNU bug report logs -
#60983
29.0.60; Tree-sitter user-level control
Previous Next
Full log
View this message in rfc822 format
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Theodor Thornhill <theo <at> thornhill.no>, casouri <at> gmail.com,
> 60983 <at> debbugs.gnu.org
> Date: Sun, 29 Jan 2023 21:28:29 -0500
>
> > I asked Stefan to help precisely because I don't understand why we
> > need anything beyond what we have already. I thought mode inheritance
> > should have taken care of it, or at least the documentation of
> > define-derived-mode seems to imply that.
>
> But the `define-derived-mode` uses `prog-mode` as parent, so while the
> keymap does inherit from its parent mode's keymap, it's just
> `prog-mode-map` rather than `c-ts-mode-map`.
Ah, so it's this bit of define-derived-mode's documentation:
• The new mode has its own sparse keymap, named ‘VARIANT-map’.
‘define-derived-mode’ makes the parent mode’s keymap the
parent of the new map, unless ‘VARIANT-map’ is already set and
already has a parent. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^
IOW, the problem is that c-ts-base-mode defined c-ts-mode-map as its
keymap, so when c-ts-mode is defined, its keymap variable "is already
set and already has a parent".
Thanks, this is now fixed.
This bug report was last modified 2 years and 193 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.