org-cycle: Allow intuitively used values of of `org-startup-folded'
* lisp/org-cycle.el (org-cycle-set-startup-visibility): Recognize `org-startup-folded' set to symbols `fold', `nofold', and `showall'. They are used as #+STARTUP: option and often tried blindly by users.
This commit is contained in:
parent
fe92a3cedb
commit
747e60629f
|
@ -608,7 +608,9 @@ With a numeric prefix, show all headlines up to that level."
|
||||||
(defun org-cycle-set-startup-visibility ()
|
(defun org-cycle-set-startup-visibility ()
|
||||||
"Set the visibility required by startup options and properties."
|
"Set the visibility required by startup options and properties."
|
||||||
(cond
|
(cond
|
||||||
((eq org-startup-folded t)
|
;; `fold' is technically not allowed value, but it is often
|
||||||
|
;; intuitively tried by users by analogy with #+STARTUP: fold.
|
||||||
|
((memq org-startup-folded '(t fold))
|
||||||
(org-cycle-overview))
|
(org-cycle-overview))
|
||||||
((eq org-startup-folded 'content)
|
((eq org-startup-folded 'content)
|
||||||
(org-cycle-content))
|
(org-cycle-content))
|
||||||
|
@ -620,8 +622,10 @@ With a numeric prefix, show all headlines up to that level."
|
||||||
(org-cycle-content 4))
|
(org-cycle-content 4))
|
||||||
((eq org-startup-folded 'show5levels)
|
((eq org-startup-folded 'show5levels)
|
||||||
(org-cycle-content 5))
|
(org-cycle-content 5))
|
||||||
((or (eq org-startup-folded 'showeverything)
|
;; `nofold' and `showall' are technically not allowed values, but
|
||||||
(eq org-startup-folded nil))
|
;; they are often intuitively tried by users by analogy with
|
||||||
|
;; #+STARTUP: nofold or #STARUP: showall.
|
||||||
|
((memq org-startup-folded '(showeverything nil nofold showall))
|
||||||
(org-fold-show-all)))
|
(org-fold-show-all)))
|
||||||
(unless (eq org-startup-folded 'showeverything)
|
(unless (eq org-startup-folded 'showeverything)
|
||||||
(when org-cycle-hide-block-startup (org-fold-hide-block-all))
|
(when org-cycle-hide-block-startup (org-fold-hide-block-all))
|
||||||
|
|
Loading…
Reference in New Issue