reddit / emacs

org-mode: Property drawers not hidden / collapsed anymore

pragmat1c1 · 2022-06-12 09:52
After I updated from org-plus-contrib (org-mode) 9.4.1 to org-mode version 9.5, my property drawers are not collapsed / hidden anymore when I cycle visibility via TAB. I changed `org-startup-folded` to `t`, but that didn't change anything. What am I missing? ## Edit I could advice TAB or `outline-cycle` to fire `(org-hide-drawer-all)`, but this shouldn't be necassry because previously I did not have any hooks or advices. ## Edit 2 This is what I have in my `org-cycle-hook` variable: ``` org-cycle-hook is a variable defined in ‘org.el’. Its value is (org-hide-drawer-all org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) Original value was (org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) ``` ## Edit 3 Opening Emacs via `emacs -Q`, then opening an org file, I see that the property drawers are hidden when I cycle via TAB key.
yantar92 · 2022-06-12 12:03
> Opening Emacs via emacs -Q, then opening an org file, I see that the property drawers are hidden when I cycle via TAB key. So, it should be something in your config?
pragmat1c1 · 2022-06-12 12:19
Yes, but how to find the culprit. - Checked `custom.el`, nothting there. Neither in `init.el`. So I tried: `(setq org-startup-folded 'content)`, not working either.
yantar92 · 2022-06-12 12:22
You can try to bisect your config. Check https://github.com/Malabarba/elisp-bug-hunter and https://open.tube/videos/watch/4d819114-43bf-42df-af94-f94fc53dd0d9
pragmat1c1 · 2022-06-12 12:32
When I hit TAB, this is being triggered: `outline-cycle` from `outline-magic.el` And especially this section (lines 301-304): ((>= eol eos) ;; Entire subtree is hidden in one line: open it (show-entry) (show-children) (message "CHILDREN") (setq this-command 'outline-cycle-children)) Apparently `(show-entry)` or `(show-children)` should hide drawers?
yantar92 · 2022-06-12 12:35
This is not supposed to happen. <TAB> should be bound to `org-cycle`. So, something is re-binding the default Org keys. You need to find what it is.
pragmat1c1 · 2022-06-12 13:01
Thank you very much. Found the error (now commented out): ``` ;; ------------------------------------------------------------------------ ;;; yaml mode and folding ;; ------------------------------------------------------------------------ ;; https://www.reddit.com/r/emacs/comments/a6tu8y/outlineminormode_for_emacs_maybe_useful/?utm_source=share&utm_medium=web2x&context=3 ;; Created: Sunday, 12. June 2022 at 14:58 ;; This here messed up with org-cycle! ;; See here: https://www.reddit.com/r/emacs/comments/vaiogt/orgmode_property_drawers_not_hidden_collapsed/ic2xy6p/?context=3 ;; ;; (eval-after-load 'outline ;; '(progn ;; (require 'outline-magic) ;; (define-key outline-minor-mode-map (kbd "<C-tab>") 'outline-cycle))) ;; (add-hook 'outline-minor-mode-hook ;; (lambda () ;; (define-key outline-minor-mode-map (kbd "<tab>") 'outline-cycle) ;; (define-key outline-minor-mode-map (kbd "S-<iso-lefttab>") ;; #'(lambda() ;; (interactive) ;; (save-excursion ;; (goto-char (point-min)) ;; (outline-show-all) ;; (outline-hide-leaves)))))) ```