alphapapa / org-sidebar

A helpful sidebar for Org mode
GNU General Public License v3.0
527 stars 16 forks source link

Org-sidebar-tree-cycle not working properly in Org 9.6 #60

Closed arozbiz closed 6 months ago

arozbiz commented 1 year ago

I just upgraded to Org 9.6 ("GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2022-12-04") and org-sidebar-tree-cycle no longer works correctly. When I run it once it folds closed, but running it again does not cycle---it just stays closed.

alphapapa commented 1 year ago

Hello,

Yes, this is likely because of this note in the Org 9.6 changelog: https://orgmode.org/Changes.html

outline- functions may no longer work correctly in Org mode The new folding backend breaks some of the outline- functions that rely on the details of visibility state implementation in outline.el. The old Org folding backend was compatible with the outline.el folding, but it is not the case anymore with the new backend. From now on, using outline-* functions is strongly discouraged when working with Org files.

It's likely that that change will cause breakage in a lot of other packages too, requiring each one to have compatibility code added for Org 9.6+.

I was expecting to get bug reports like this on some of my packages; you win the award for being the first to report one. :)

Anyway, I'll fix this when I have time, but I don't have a lot of that right now, so it may not be soon.

titaniumbones commented 7 months ago

I don't know what i'm doing here :-) but the following half works. it breaks when tabbing on entries with no children, though:

(defun org-cycle-skip-subtree (state)
  (when (eq state 'children)
    (setq org-cycle-subtree-status 'subtree)))
(defun org-activate-subtree-skip ()
  (setq-local org-cycle-skip-children-state-if-no-children t)
  (add-hook 'org-cycle-hook
            'org-cycle-skip-subtree nil t  )
  )
alphapapa commented 6 months ago

Will track this more generally in #64.