bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60983: 29.0.60; Tree-sitter user-level control


From: Eli Zaretskii
Subject: bug#60983: 29.0.60; Tree-sitter user-level control
Date: Mon, 30 Jan 2023 15:45:18 +0200

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Theodor Thornhill <theo@thornhill.no>,  casouri@gmail.com,
>   60983@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.





reply via email to

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