all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Adding indent-bars to ELPA
Date: Wed, 24 Jul 2024 14:33:16 -0400	[thread overview]
Message-ID: <CB9F3A4A-C5E4-4ECA-B60F-9B5676326453@gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2024-07-24 18:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 18:33 JD Smith [this message]
2024-07-24 19:08 ` Adding indent-bars to ELPA 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB9F3A4A-C5E4-4ECA-B60F-9B5676326453@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.