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

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

bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does


From: Eli Zaretskii
Subject: bug#60880: 30.0.50; tree-sitter `treesit-explore-mode' is buggy and does not behave properly
Date: Fri, 20 Jan 2023 09:02:01 +0200

> Cc: 60880@debbugs.gnu.org
> From: Yuan Fu <casouri@gmail.com>
> Date: Thu, 19 Jan 2023 14:30:46 -0800
> 
> 
> Mickey Petersen <mickey@masteringemacs.org> writes:
> 
> > A medley of issues here:
> >
> > 1. Executing `treesit-explore-mode' on a buffer with no valid grammar
> > support causes the minor mode (and playground buffer) to stick around and 
> > "load" anyway.
> >
> > 2. Bailing out of the grammar prompt does not, in actual fact, stop
> > explore mode from proceeding. Instead it creates an empty buffer and
> > it still engages the minor mode.
> >
> > 3. Killing the playground buffer does not remove the explore mode buffer.
> >
> > 4. treesit-explore-mode is stored against a buffer during
> > `desktop-save' (and subsequently read with) `desktop-read'. Thus
> > broken buffers or files inherit the explore mode. This is especially
> > pernicious due to #1, #2, and #3.
> 
> Ok, I fixed those problems. Now if the language is not available,
> treesit-explore-mode raises an error instead of continuing, desktop-save
> will not save the explorer buffer, and killing the source buffer also
> kills the explorer buffer.

I don't think the desktop-save part is correct: the test should be at
desktop-read time, not at desktop-save time.  Because the fact we had
the language available when we saved the desktop doesn't guarantee we
will have it available when restoring that desktop: it could be in a
different build of Emacs or even on a different machine.

I'm not sure I understand the problem which desktop-read has when
restoring desktop with buffers in treesit-explore-mode, but if the
problems are more than just warning messages, then desktop-read should
detect these problems, emit an echo-area message, and refrain from
restoring the mode.  Like it does with buffers that visited files
which are no longer there, for example.





reply via email to

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