eskran · 2022-11-12 12:07
Hello, first post here. I have been a happy emacs user since I knew about its existence and now I'm a even happier user of org. My question is about org's indent mode and custom themes. Apparently, org's indent mode creates the illusion of indentation by inserting dummy '\*'s at the beginning of each sub-header, and making them invisible. When I switch custom themes, most themes do not consistently set colours in such a way that those dummy stars are invisible, that is, I guess, have the background colour. I am aware that custom themes cannot be undone by design, however, as a matter of fact, some themes do work consistently correctly with respect to indent mode, notably, all sanityinc's ones. Is it feasible to isolate the relevant feature of sanityinc's themes and replicate it in other themes to fix them?
yantar92 · 2022-11-12 13:20
AFAIK, you just need to load the theme before Org. The face for hidden stars is `org-indent`, which inherits from `org-hide`, which sets the face according to frame background when Org is loaded.
MitchellMarquez42 · 2022-11-12 20:24
(setq org-hide-leading-stars t)
eskran · 2022-11-14 18:57
org-hide-leading-stars was true in org buffers, locally. Switching it to on globally did not make custom themes display leading stars with the same colour as the background, when a new theme is selected.
eskran · 2022-11-14 18:59
Indeed, I had noted that reloading org-mode after selecting a custom theme did fix the colour of hidden leading stars, for many custom themes. But it does not do that consistently for all of them. BTW I'm using GNU Emacs 29.0.50 (build 1, x86\_64-w64-mingw32). Previous versions, stable or not, behaved similarly.
I tested whether one specific theme which could not be made to hide the leading stars by reloading org behaved correctly when manually loaded as first themes after startup, and before loading org manually. It did not, and for an obvious reason: while hidden stars have the background colour, the background of headers is not the text background colour, and not just the header title text, but the whole line from column 1 to the rightmost character in the header title text. Apparently, that is a feature of the theme. In fact, another theme, which changes the header title background, does not change it from column 1 to the last but one star. For example, for such a theme, if the normal text background is, say, wheat, and the header title background is light blue, then the line of a 2nd level header with \*\*\* as stars is displayed in wheat and black for the first two stars, and light blue and blue for the third star and the header title text, before reloading org mode.
yantar92 · 2022-11-14 23:01
Note that it is the custom theme that should take care about setting this correctly. If it fails to set `org-hide` face, it is something to be fixed in the theme. Same for any other non-matching font.
JDRiverRun · 2022-11-15 03:17
org-indent-mode, via font-lock, calculates an indentation depth and adds a line-prefix (and wrap-prefix) property per line with that many spaces. Those spaces are styled with the face org-indent, so if you alter that, you can see the indentation it adds. Note that no spaces are actually put in the text, only the text styling is altered to indent it. Maybe your theme alters the org-hide face, from which org-indent inherits? M-x describe-face org-indent and follow links.