emacs-devel
[Top][All Lists]
Advanced

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

Re: prettify-symbols-mode, derived modes, and compose-region


From: D
Subject: Re: prettify-symbols-mode, derived modes, and compose-region
Date: Fri, 5 Mar 2021 01:22:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

> I'm not sure I understand the problem, but can't you use :align-to in
> display properties to solve the alignment issues?

To provide a concrete example, consider the following (closed) issue:
https://github.com/integral-dw/org-superstar-mode/issues/9

The data structure org-superstar-todo-bullet-alist associates a todo
keyword with a character to be displayed.  The image shows the alignment
problem.  The compose-region solution to this is simply to compose each
character with a wide enough space, so the user simply has to use
"\N{EM SPACE}<character>" instead of ?<character> in the alist.
compose-region will then just superimpose the two and you get a "padded"
character.  It is very much possible that :align-to could fix this as
well, judging from the documentation it does sound like it can reproduce
this feature easily.  To see how well it works out I would likely have
to implement a display-based version first, though.

On a side note: Are there any quirks I should be aware of when
transitioning to the display property? I doubt there will be any
difference in terms of performance (contrast overlays, which my mode
can't afford use), but is there anything else I should be aware of?  I'm
asking in case there have been efforts like mine in the past which I am
not aware of.



reply via email to

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