integral-dw / org-superstar-mode

Make org-mode stars a little more super
GNU General Public License v3.0
506 stars 22 forks source link

Hidden stars do not persist on theme change #13

Closed Luis-Henriquez-Perez closed 4 years ago

Luis-Henriquez-Perez commented 4 years ago

I see in the README that you mention you don't implement a "hide leadeing stars" feature because org already implements it in terms of org-hide-leading-stars. The thing is that for me the hidden leading stars do not persist on theme changes with Org's variable. However, using org-bullets the hidden leading stars stay hidden even on theme change. I would like the same thing to be the case with org-superstar.

integral-dw commented 4 years ago

Hi, that seems to indicate that the theme you are using changes/forgets to change the face org-hide. If you want I can try to whip up a definition for org-hide that should work: could you provide a screenshot of the (now visible) leading stars? If you do not want to change org-hide to fix this, there is also another trick, but that would also stop the stars from becoming visible when you (for example) mark a region: they would look like spaces proper, in any context.

Luis-Henriquez-Perez commented 4 years ago

that seems to indicate that the theme you are using changes/forgets to change the face org-hide

I see. Most of my themes do this.

could you provide a screenshot of the (now visible) leading stars?

Sure.

visible-stars

you do not want to change org-hide to fix this

What are the consequences of changing org-hide?

trick, but that would also stop the stars from becoming visible when you (for example) mark a region: they would look like spaces proper, in any context.

Is this how org bullet achieved this?

(if series
    (dotimes (pos (1- level))
      (compose-region (+ (match-beginning 0) pos)
                      (+ (match-beginning 0) pos 1)
                      (org-bullets--char-series series pos))))
integral-dw commented 4 years ago

Is this how org bullet achieved this?

Sadly, there is a plethora of different versions available of org-bullets at this point, all with their subtle differences. The one currently available on MELPA uses org-hide, much like this package. Another, older version simply set the background color to the foreground color. Iirc, the version I originally analyzed had that hardcoded, which led to issues.

What are the consequences of changing org-hide?

In general, org-hide is used by Org to remove visual clutter in a simple way. It's just a face which usually uses the background color also for the foreground, so setting up the face like that for a theme ensures it keeps it's intended purpose.

Also, the trick I mentioned that should work independently of Org hide should be:

(setq org-superstar-leading-bullet ?\s)
(setq org-hide-leading-stars nil)

This will display leading stars as spaces.

Luis-Henriquez-Perez commented 4 years ago

Wow that is clever! Thank you for this trick and thank you for writing this excellent package.

integral-dw commented 4 years ago

You're welcome! I'll add this trick to the README somewhere to avoid duplication.