Don't unfold to 2nd level in org-mode by default
This is too opinionated to be a default, and has thus been replaced with "unfold subtree around point when opening an org file", in case saveplace has restored the point to a folded region.
This commit is contained in:
parent
6c01d1a5ac
commit
31e4bfb2d4
2 changed files with 9 additions and 18 deletions
|
@ -434,20 +434,14 @@ with `org-cycle')."
|
||||||
t))
|
t))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-unfold-to-2nd-level-or-point-h ()
|
(defun +org-make-last-point-visible-h ()
|
||||||
"Alters '#+STARTUP overview' to only expand first-level headings.
|
"Unfold subtree around point if saveplace places it to a folded region."
|
||||||
Expands the first level, but no further. If a different startup option was
|
(and (not org-agenda-inhibit-startup)
|
||||||
provided, do that instead."
|
(outline-invisible-p)
|
||||||
(unless org-agenda-inhibit-startup
|
(ignore-errors
|
||||||
;; TODO Implement a custom #+STARTUP option?
|
(save-excursion
|
||||||
(when (eq org-startup-folded t)
|
(outline-previous-visible-heading 1)
|
||||||
(outline-hide-sublevels +org-initial-fold-level))
|
(org-show-subtree)))))
|
||||||
;; If point was left somewhere deeper, unfold to point on startup.
|
|
||||||
(when (outline-invisible-p)
|
|
||||||
(ignore-errors
|
|
||||||
(save-excursion
|
|
||||||
(outline-previous-visible-heading 1)
|
|
||||||
(org-show-subtree))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-remove-occur-highlights-h ()
|
(defun +org-remove-occur-highlights-h ()
|
||||||
|
|
|
@ -50,9 +50,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
||||||
(defvar +org-capture-projects-file "projects.org"
|
(defvar +org-capture-projects-file "projects.org"
|
||||||
"Default, centralized target for org-capture templates.")
|
"Default, centralized target for org-capture templates.")
|
||||||
|
|
||||||
(defvar +org-initial-fold-level 2
|
|
||||||
"The initial fold level of org files when no #+STARTUP options for it.")
|
|
||||||
|
|
||||||
(defvar +org-habit-graph-padding 2
|
(defvar +org-habit-graph-padding 2
|
||||||
"The padding added to the end of the consistency graph")
|
"The padding added to the end of the consistency graph")
|
||||||
|
|
||||||
|
@ -991,7 +988,7 @@ compelling reason, so..."
|
||||||
#'doom-disable-show-trailing-whitespace-h
|
#'doom-disable-show-trailing-whitespace-h
|
||||||
#'+org-enable-auto-reformat-tables-h
|
#'+org-enable-auto-reformat-tables-h
|
||||||
#'+org-enable-auto-update-cookies-h
|
#'+org-enable-auto-update-cookies-h
|
||||||
#'+org-unfold-to-2nd-level-or-point-h)
|
#'+org-make-last-point-visible-h)
|
||||||
|
|
||||||
(add-hook! 'org-load-hook
|
(add-hook! 'org-load-hook
|
||||||
#'+org-init-org-directory-h
|
#'+org-init-org-directory-h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue