GNU bug report logs -
#19080
24.4; wish: enable show-paren-mode to highlight matching same-level keywords
Previous Next
Reported by: Josh Berdine <josh <at> berdine.net>
Date: Mon, 17 Nov 2014 14:03:03 UTC
Severity: wishlist
Tags: wontfix
Found in version 24.4
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #21 received at 19080 <at> debbugs.gnu.org (full text, mbox):
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Thu, 12 May 2022 15:52:14 -0700
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>,
> josh <at> berdine.net,
> 19080 <at> debbugs.gnu.org
>
> > We could perhaps add a new feature, based on tree-sitter, to highlight
> > a block of code, where the block is defined by PL rules, not by
> > parens, braces, and similar simple syntactic elements.
> >
> > Yuan, WDYT? Can this be added to the tree-sitter branch perhaps?
>
> That sounds interesting, and it should be easy. But what do we want the API be? First of all, should we make a separate mode or extend show-paren-mode? Extending show-paren-mode entails doing some non-trivial refactoring to paren.el.
IMO, it should be a separate minor mode; show-paren-mode is not
necessarily about program blocks, since parentheses appear not only
(and mostly not) as block delimiters.
The API should be probably: given a buffer POSITION, return the 2
positions of the innermost enclosing block, or nil if POSITION is not
in any block. A possible extension could be to return a list of
position pairs that provide also the blocks enclosed inside the
POSITION's block.
> I think, that adding tree-sitter “backend” needs refactoring existing code non-trivially.
If show-paren-mode would want to use tree-sitter, it will need
refactoring, yes. Which other packages you envision could benefit
from using tree-sitter?
This bug report was last modified 3 years and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.