GNU bug report logs - #68246
30.0.50; Add non-TS mode as extra parent of TS modes

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 4 Jan 2024 22:12:01 UTC

Severity: wishlist

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 68246 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes
Date: Fri, 05 Jan 2024 15:26:00 +0200
> From: João Távora <joaotavora <at> gmail.com>
> Date: Fri, 5 Jan 2024 11:27:53 +0000
> Cc: monnier <at> iro.umontreal.ca, 68246 <at> debbugs.gnu.org
> 
> base-foo-mode is a natural place for setup that is common
> to both foo-mode and foo-ts-mode to exist.  There is a
> good number of things that are independent of the particular
> implementation of parsing (lisp-based vs ts-based).
> 
> Is it too late for the ts-modes to be looked at like that?

It doesn't always make sense.  Where it does make sense, I think we
did it (see python-ts-mode, for example).

> It seems our approach to TS modes often/always looks like
> 'foo-rewrite-completely-using-ts-while-at-it-mode'.

That's right -- but it's justified.  The commonality is usually either
very thin or almost non-existent.  If you think about it, you will
understand: where the traditional modes use regexps and syntax-pss,
the TS modes use parser-related primitives.  How can you find common
grounds between these so different bases for implementation?

> > It should modify our .dir-locals.el and Eglot's database to
> > remove special entries for TS modes
> 
> As Dmitry mentioned: if that is done just like that it will
> break Eglot's support of ts modes in any Emacs which doesn't
> have Stefan's patch.

Then Eglot (or maybe compat.el) will have to provide compatibility
shims.  But for .dir-locals.el, I still think we should update it.

> Also, I know this mail is long enough, but apropos Eglot's
> database, it's getting quite large as you may notice.  Another,
> much more natural way to simplify it would be, if major-modes
> started setting eglot-server-program (singular) buffer-locally
> variable which takes precedence over eglot-server-programs.

Maybe.  But that's an unrelated issue.




This bug report was last modified 1 year and 105 days ago.

Previous Next


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