localauthor / org-side-tree

Navigate Org-mode outlines in Emacs via side window
GNU General Public License v3.0
40 stars 4 forks source link

Heading display inconsistent with org file when it's enabled with org-superstar-mode & no indentation #9

Closed IceAsteroid closed 7 months ago

IceAsteroid commented 7 months ago

I've set indicators such as 一, 二, 三, 四 for each heading level via org-superstar, so there's no need to either display leading stars nor to be indented to waste more space especially in the org-side-tree buffer.

But the org-side-tree buffer cannot display properly with org-superstar, it will look like follows:

screenShot-grim_20231212000420

If I further set (add-hook 'org-side-tree-mode-hook (lambda () (setq-local org-hide-leading-stars t))), it still doesn't work, but the variable appears to be set when I run C-h v(describe-variable) in the org-side-tree buffer.

Only if I set (setq org-hide-leading-stars t)) in the global scope of my init file, it will then look as follows:

screenShot-grim_20231212010857

My guess this is caused by that org-side-tree isn't using org-mode, but instead outline-mode to fetch org-headings, which is without org-superstar-mode enabled.

However, I can't enable org-superstar-mode specifically for org-side-tree's buffer anyway, as it complaints Org mode is not enabled in this buffer. [2 times]

But, if I enable org-mode for org-side-tree, this time the color of each heading vanishes to be plain as follows:

screenShot-grim_20231212010410

Any ideas?

localauthor commented 7 months ago

The latest commit should fix this.

Details: The buffer-invisibility-spec in the tree-buffer did not match the one in the base-buffer, so even though the asterisks had an"invisible" property, it was not being honored.

localauthor commented 7 months ago

Also, just for reference, the variable org-hide-leading-stars only affects the color of the leading stars. That is, it tries to make the stars match the background, so that you don't see them. It doesn't remove them from the buffer. What makes the stars actually disappear --- that is, what makes them "invisible," in the elisp sense --- is the variable org-superstar-remove-leading-stars. The more you know... 💫

IceAsteroid commented 7 months ago

Yes, I have that variable set for org-superstart

  (use-package org-superstar
    :ensure t
    :hook
    (org-mode . (lambda () (org-superstar-mode 1)))
    :init
    ;; This is usually the default, but keep in mind it must be nil
    (setq org-hide-leading-stars nil)
    ;; This line is necessary.
    (setq org-superstar-leading-bullet ?\s)
    ;; If you use Org Indent you also need to add this, otherwise the
    ;; above has no effect while Indent is enabled.
    (setq org-indent-mode-turns-on-hiding-stars nil)
    ;;(setq org-superstar-leading-bullet 11044)
    (setq org-superstar-headline-bullets-list '(19968 20108 19977 22235 20116 20845 19971 20843 20061 8553 8554 8555))
    (setq org-superstar-remove-leading-stars t))

The newest commit has fixed this. Beautiful, thank you!

screenShot-grim_20231212155025