A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01328.html below:

Re: Tree-sitter and major mode inheritance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Eli Zaretskii Subject: Re: Tree-sitter and major mode inheritance Date: Sun, 20 Nov 2022 09:28:09 +0200
> Date: Sun, 20 Nov 2022 01:42:04 +0200
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org,
>  monnier@iro.umontreal.ca, theo@thornhill.no
> From: Dmitry Gutov <dgutov@yandex.ru>
> 
> On 20.11.2022 01:36, Yuan Fu wrote:
> > If we keep js-mode as-is, and add js-base-mode and js-ts-mode, 
> > (derived-mode-p ‘js-mode) should keep working as before, or maybe I’m 
> > msiunderstanding your question?
> 
> (derived-mode-p 'js-mode) will return nil in js-ts-mode.
> 
> Which could be a problem when this call is used as a substitute for a 
> file type check (e.g. "are we editing a JavaScript file?"), which is one 
> of its common uses.

This test can only work on the assumption that there's a single parent mode
for all the modes which support a given programming language.  This is a
fragile assumption, so code which is based on it is broken and should be
fixed.

IOW, I don't think we should feel ourselves bound by this fragile
assumption (assuming the solution we decide on breaks it).



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4