From 44acd0004998c9dc6f876c6d02685ab1de8557b3 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 4 Jan 2014 12:22:50 +0100 Subject: [PATCH] org.el (org-set-startup-visibility): Bugfix * org.el (org-set-startup-visibility): Bugfix. See http://article.gmane.org/gmane.emacs.orgmode/79905 --- lisp/org.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 5d6242378..b6e23cbfc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6827,10 +6827,12 @@ With a numeric prefix, show all headlines up to that level." "Set the visibility required by startup options and properties." (cond ((eq org-startup-folded t) - (org-cycle '(4))) + (org-overview)) ((eq org-startup-folded 'content) - (let ((this-command 'org-cycle) (last-command 'org-cycle)) - (org-cycle '(4)) (org-cycle '(4))))) + (org-content)) + ((or (eq org-startup-folded 'showeverything) + (eq org-startup-folded nil)) + (show-all))) (unless (eq org-startup-folded 'showeverything) (if org-hide-block-startup (org-hide-block-all)) (org-set-visibility-according-to-property 'no-cleanup) @@ -6910,7 +6912,6 @@ With numerical argument N, show content up to level N." (show-branches)) (if (bobp) (throw 'exit nil)))))) - (defun org-optimize-window-after-visibility-change (state) "Adjust the window after a change in outline visibility. This function is the default value of the hook `org-cycle-hook'." -- 2.11.4.GIT