diff options
author | Bastien Guerry <bzg@altern.org> | 2012-12-31 11:07:06 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-12-31 11:07:06 +0100 |
commit | 6fd066fb183fced8a8410d49a108420988e63321 (patch) | |
tree | 5fced8761698ee0c8713544f89f429d182f282b0 | |
parent | 6a758e26fff9f0f533eda18677b0297717f57087 (diff) | |
parent | 61993bc4bf86769ef37573c5b7db40feebb34d53 (diff) | |
download | org-mode-6fd066fb183fced8a8410d49a108420988e63321.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el index 22a526c..825cd8c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6440,7 +6440,8 @@ in special contexts. (cond ((= eos eoh) ;; Nothing is hidden behind this heading - (run-hook-with-args 'org-pre-cycle-hook 'empty) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'empty)) (message "EMPTY ENTRY") (setq org-cycle-subtree-status nil) (save-excursion @@ -6453,7 +6454,8 @@ in special contexts. (not (setq children-skipped org-cycle-skip-children-state-if-no-children)))) ;; Entire subtree is hidden in one line: children view - (run-hook-with-args 'org-pre-cycle-hook 'children) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'children)) (if (org-at-item-p) (org-list-set-item-visibility (point-at-bol) struct 'children) (org-show-entry) @@ -6481,24 +6483,28 @@ in special contexts. (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil))) (setq org-cycle-subtree-status 'children) - (run-hook-with-args 'org-cycle-hook 'children)) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'children))) ((or children-skipped (and (eq last-command this-command) (eq org-cycle-subtree-status 'children))) ;; We just showed the children, or no children are there, ;; now show everything. - (run-hook-with-args 'org-pre-cycle-hook 'subtree) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-pre-cycle-hook 'subtree)) (outline-flag-region eoh eos nil) (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status 'subtree) - (run-hook-with-args 'org-cycle-hook 'subtree)) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'subtree))) (t ;; Default action: hide the subtree. (run-hook-with-args 'org-pre-cycle-hook 'folded) (outline-flag-region eoh eos t) (message "FOLDED") (setq org-cycle-subtree-status 'folded) - (run-hook-with-args 'org-cycle-hook 'folded))))) + (unless (org-before-first-heading-p) + (run-hook-with-args 'org-cycle-hook 'folded)))))) ;;;###autoload (defun org-global-cycle (&optional arg) |