GNU bug report logs - #65540
29.1.50; treesit-inspect-mode does not escape `treesit--inspect-name`

Previous Next

Package: emacs;

Reported by: Augustin Chéneau (BTuin) <btuin <at> mailo.com>

Date: Fri, 25 Aug 2023 22:09:02 UTC

Severity: normal

Found in version 29.1.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 65540-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "Augustin Chéneau (BTuin)" <btuin <at> mailo.com>,
 65540-done <at> debbugs.gnu.org
Subject: Re: bug#65540: 29.1.50; treesit-inspect-mode does not escape
 `treesit--inspect-name`
Date: Sun, 27 Aug 2023 14:55:20 -0700

> On Aug 25, 2023, at 10:24 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Date: Sat, 26 Aug 2023 00:08:00 +0200
>> From: Augustin Chéneau (BTuin) <btuin <at> mailo.com>
>> 
>> The minor mode `treesit-inspect-mode` uses the mode-line to display the
>> current node. However, a node name containing a string is displayed
>> incorrecly because mode-line will try to interpret it as a
>> '%-contruct'. Each '%' needs to be escaped as a double percent ('%%').
>> 
>> The attached patch should fix the issue (works for me).
> 
> Thanks.  Yuan, any comments, or should I install this?

Thanks, Augustin, and Eli. I pushed a simpler patch (we only set treesit--inspect-name in that one place, so probably don’t need a function for it).

> I thought about an alternative: do something like that in
> treesit-inspect-node-at-point, where the value of
> treesit--inspect-name is computed, but perhaps we want to allow that
> variable to be set by other Lisp programs (although it's an internal
> variable)?

That’s an possible approach, but what we have now works just fine.

Yuan



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

Previous Next


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