Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPORTANT] compose versus display: future-proofing Superstar #25

Open
integral-dw opened this issue Feb 18, 2021 · 5 comments
Open

[IMPORTANT] compose versus display: future-proofing Superstar #25

integral-dw opened this issue Feb 18, 2021 · 5 comments
Assignees
Labels
compatibility Improve integration with Org or other packages

Comments

@integral-dw
Copy link
Owner

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 integral-dw added the compatibility Improve integration with Org or other packages label Feb 18, 2021
@integral-dw integral-dw self-assigned this Feb 18, 2021
@integral-dw integral-dw changed the title compose versus display: future-proofing Superstar compose versus display`: future-proofing Superstar Feb 18, 2021
@integral-dw integral-dw changed the title compose versus display`: future-proofing Superstar compose versus display: future-proofing Superstar Feb 18, 2021
@integral-dw
Copy link
Owner Author

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

@integral-dw
Copy link
Owner Author

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.

@andersjohansson
Copy link
Contributor

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.

@integral-dw
Copy link
Owner Author

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 integral-dw pinned this issue Mar 10, 2021
@integral-dw integral-dw changed the title compose versus display: future-proofing Superstar [IMPORTANT] compose versus display: future-proofing Superstar Mar 10, 2021
@andersjohansson
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Improve integration with Org or other packages
Projects
None yet
Development

No branches or pull requests

2 participants