org-superstar-mode icon indicating copy to clipboard operation
org-superstar-mode copied to clipboard

[IMPORTANT] compose versus display: future-proofing Superstar

Open integral-dw opened this issue 3 years ago • 5 comments

Regarding this comment:

I'm sorry, but I don't share your enthusiasm about prettify-symbols-mode. It piggy-backs a feature, called "static character composition", which was never designed for this job, and which is nowadays rarely if ever used for the job it was designed for. So it has bit-rotted, and in some not-too-far future we will probably want to obsolete and remove the static character composition from Emacs, at which point prettify-symbols-mode will be a huge drag.

This is, of course, a valid point. I will have to contact the Emacs mailing list on this, because of course it's a hack, and depending on the general sentiment I will have to act accordingly (after all, we all want Superstar to not suddenly croak with a major release).

integral-dw avatar Feb 18 '21 00:02 integral-dw

Remark: This Issue is a continuation of a discussion sparked in #23, which see.

integral-dw avatar Feb 18 '21 00:02 integral-dw

I was thinking in similar lines, wanting to have some more control over the display of bullets (specifically if it would be possible to add a face to the todo bullets). What I thought of then was to just use the display property instead of compose. Seemed to work (outdated and ugly testing branch here, but I'm confused why it worked without adding display to font-lock-extra-managed-props). But I suppose there is a good reason for using compose over display that I have missed (Maybe relating to indentation?).

Originally posted by @andersjohansson

There was one essential thing I forgot to bring up! While PS (ab)uses compose exclusively for the nice way it works with indentation, this mode actually makes use of a feature that can't easily be replicated without composition: padding! The issue with using UTF8 characters as bullets is that your favorite set of such characters may not be equally wide (provided a given fontset, etc, etc.) This can lead to unpleasant alignment problems, which are trivially fixed by taking a sufficiently wide space character and superimposing the target bullet.

integral-dw avatar Feb 18 '21 00:02 integral-dw

Oh, yeah, I had also read that comment from Eli about compose being “bad” in some way. Seems reasonable to think about what the “right” future-proof implementation should be.

andersjohansson avatar Feb 19 '21 15:02 andersjohansson

I got news! So, after some talk on the mailing list I have come to the conclusion that trying to migrate org-superstar to the display property should become a long-term goal of this package. The full conversation can be found here. I will, of course, maintain backwards compatibility to the best of my ability. I will also need to address this in the README as well as in my template repo superstar-kit. As it stands, we cannot rely on the current implementation to continue working forever. This is the most important outcome of this.

integral-dw avatar Mar 10 '21 23:03 integral-dw

Sounds great, even if it will be some work. Another good thing with using display is that it could be possible to directly set the font (through setting the face property of the displayed string) used for bullets (if the bullets are stored as strings, they could probably just be stored with text properties).

I do want to use some bullets that are not available in my default text font, and his way, I wouldn’t have to rely on emacs font fallback to choose a good font (with suitable heights) for the bullets.

andersjohansson avatar Mar 19 '21 09:03 andersjohansson