unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Adding indent-bars to ELPA
@ 2024-07-24 18:33 JD Smith
  2024-07-24 19:08 ` Eli Zaretskii
  2024-09-14 13:33 ` JD Smith
  0 siblings, 2 replies; 9+ messages in thread
From: JD Smith @ 2024-07-24 18:33 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2757 bytes --]


I propose the addition of indent-bars to ELPA.

https://github.com/jdtsmith/indent-bars
jdtsmith/indent-bars: Fast, configurable indentation guide-bars for Emacs
github.com


This mode provides highly configurable indentation guide bars using stipple or character display.  Recent versions add optional treesitter-enabled local "scope" for additional focus.  There are many options to influence the behavior and appearance of the bars. 

A couple of issues relevant to developers: stipple support, and multi-backend jit-lock.

Stipple support:

During development, I was surprised to learn that not all emacsen support stipple display.  This situation is as far as I know not documented anywhere, though it does seem to be improving:

- PGTK builds had partially broken stipple support, but this was recently fixed (bug#64969)
- The NS port has had partial stipple support recently added, but this fix is incomplete — color is missing, for example (bug#70712). 
- Stipple support was added very recently to Windows (bug#71159).
- Cairo apparently interferes with/inhibits stipple display, based on a user report.
- Other builds AFAIK support stipple display, including unofficial builds like emacs-mac.

In any case, stipples aren't required for indent-bars to function, since character display can be used (also for terminal), but it seems like consistent stipple support across supported builds matching the docs would be worthwhile.  For now I have documented this issue and provided a test [1] to determine whether your emacs supports stipples correctly.  In case people are curious, I use window-filtered face-remapping to ensure stipples are displayed correctly on any window where they appear.  Updating these is very fast.

Multi-backend jit-lock:

Developing the full indent-bars feature set with good performance using font-lock was somewhat of a challenge, and I appreciate the good advice I received from many members of this list.  The current solution in indent-bars uses a roundabout approach to simulate multiple jit-lock backends, as we discussed in Bug#71345.  This allows position-dependent font-locking to be relatively efficient, since often only the positionally-aware highlighting needs to be updated.  This is working quite well, and to me indicates that a more formalized API for multiple jit-lock backends, all flexibly "sharing" the fontification redisplay invalidation it manages would be very useful.  Anyone interested should join the discussion there.

More generally, those who are interested in coupling position-dependent treesitter queries to font-lock may find indent-bars a useful example.

[1] https://github.com/jdtsmith/indent-bars/tree/main?tab=readme-ov-file#testing-stipples


[-- Attachment #2.1: Type: text/html, Size: 6601 bytes --]

[-- Attachment #2.2: indent-bars.png --]
[-- Type: image/png, Size: 130370 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-14 17:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 18:33 Adding indent-bars to ELPA JD Smith
2024-07-24 19:08 ` Eli Zaretskii
2024-07-24 19:30   ` [External] : " Drew Adams
2024-07-24 19:32   ` JD Smith
2024-07-25  5:11     ` Eli Zaretskii
2024-07-25 12:44       ` JD Smith
2024-09-14 13:33 ` JD Smith
2024-09-14 14:38   ` Stefan Kangas
2024-09-14 17:45     ` Bar drawing in display engine, master indent-spacing variable JD Smith

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).