mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
org-cycle.el: New custom setting `org-cycle-hide-drawer-startup'
* lisp/org-cycle.el (org-cycle-hide-drawer-startup): * lisp/org-cycle.el (org-cycle-set-startup-visibility): Add new customization to control initial folding state of the drawers. * lisp/org.el (org-startup-options): Provide #+STARTUP option for the new setting. Fixes https://list.orgmode.org/m235gww8wg.fsf@ntnu.no/T/#u
This commit is contained in:
parent
2b1b428918
commit
bcfed0f341
22
etc/ORG-NEWS
22
etc/ORG-NEWS
|
@ -291,6 +291,28 @@ The new variable name is =org-plantuml-args=. It now applies to both
|
||||||
jar PlantUML file and executable.
|
jar PlantUML file and executable.
|
||||||
|
|
||||||
** Miscellaneous
|
** Miscellaneous
|
||||||
|
*** A new custom setting =org-hide-drawer-startup= to control initial folding state of drawers
|
||||||
|
|
||||||
|
Previously, all the drawers were always folded when opening an Org
|
||||||
|
file. This only had an effect on the drawers outside folded
|
||||||
|
headlines. The drawers inside folded headlines were re-folded because
|
||||||
|
=org-cycle-hide-drawers= was present inside =org-cycle-hook=.
|
||||||
|
|
||||||
|
With the new folding backend, running =org-cycle-hide-drawers= is no
|
||||||
|
longer needed if all the drawers are truly folded on startup: [[*Folding
|
||||||
|
state of the drawers is now preserved when cycling headline
|
||||||
|
visibility]]. However, this has an unwanted effect when a user does
|
||||||
|
not want the drawers to be folded (see [[https://orgmode.org/list/m2r14f407q.fsf@ntnu.no][this bug report]]).
|
||||||
|
|
||||||
|
The new custom setting gives more control over initial folding state
|
||||||
|
of the drawers. When set to =nil= (default is =t=), the drawers are
|
||||||
|
not folded on startup.
|
||||||
|
|
||||||
|
The folding state can also be controlled on per-file basis using
|
||||||
|
=STARTUP= keyword:
|
||||||
|
|
||||||
|
: #+startup: hidedrawers
|
||||||
|
: #+startup: nohidedrawers
|
||||||
|
|
||||||
*** Styles are customizable in ~biblatex~ citation processor
|
*** Styles are customizable in ~biblatex~ citation processor
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,16 @@ This can also be set in on a per-file basis with
|
||||||
:group 'org-cycle
|
:group 'org-cycle
|
||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
|
||||||
|
(defcustom org-cycle-hide-drawer-startup t
|
||||||
|
"Non-nil means entering Org mode will fold all drawers.
|
||||||
|
This can also be set in on a per-file basis with
|
||||||
|
|
||||||
|
#+STARTUP: hidedrawers
|
||||||
|
#+STARTUP: nohidedrawers"
|
||||||
|
:group 'org-startup
|
||||||
|
:group 'org-cycle
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom org-cycle-global-at-bob nil
|
(defcustom org-cycle-global-at-bob nil
|
||||||
"Cycle globally if cursor is at beginning of buffer and not at a headline.
|
"Cycle globally if cursor is at beginning of buffer and not at a headline.
|
||||||
|
|
||||||
|
@ -603,7 +613,7 @@ With a numeric prefix, show all headlines up to that level."
|
||||||
(when org-cycle-hide-block-startup (org-fold-hide-block-all))
|
(when org-cycle-hide-block-startup (org-fold-hide-block-all))
|
||||||
(org-cycle-set-visibility-according-to-property)
|
(org-cycle-set-visibility-according-to-property)
|
||||||
(org-cycle-hide-archived-subtrees 'all)
|
(org-cycle-hide-archived-subtrees 'all)
|
||||||
(org-cycle-hide-drawers 'all)
|
(when org-cycle-hide-drawer-startup (org-cycle-hide-drawers 'all))
|
||||||
(org-cycle-show-empty-lines t)))
|
(org-cycle-show-empty-lines t)))
|
||||||
|
|
||||||
(defun org-cycle-set-visibility-according-to-property ()
|
(defun org-cycle-set-visibility-according-to-property ()
|
||||||
|
|
|
@ -3990,6 +3990,8 @@ After a match, the following groups carry important information:
|
||||||
("noptag" org-tag-persistent-alist nil)
|
("noptag" org-tag-persistent-alist nil)
|
||||||
("hideblocks" org-hide-block-startup t)
|
("hideblocks" org-hide-block-startup t)
|
||||||
("nohideblocks" org-hide-block-startup nil)
|
("nohideblocks" org-hide-block-startup nil)
|
||||||
|
("hidedrawers" org-hide-drawer-startup t)
|
||||||
|
("nohidedrawers" org-hide-drawer-startup nil)
|
||||||
("beamer" org-startup-with-beamer-mode t)
|
("beamer" org-startup-with-beamer-mode t)
|
||||||
("entitiespretty" org-pretty-entities t)
|
("entitiespretty" org-pretty-entities t)
|
||||||
("entitiesplain" org-pretty-entities nil))
|
("entitiesplain" org-pretty-entities nil))
|
||||||
|
|
Loading…
Reference in a new issue