diff options
author | Marco Wahl <marcowahlsoft@gmail.com> | 2020-07-07 00:12:39 +0200 |
---|---|---|
committer | Marco Wahl <marcowahlsoft@gmail.com> | 2020-07-07 00:12:39 +0200 |
commit | 8b92bcd827f538bb78f79c12378764ab99c689a5 (patch) | |
tree | b190243de544175a5427ff3b4fd130196fa2b21a | |
parent | 07a4a728628776202d58a48436da9f710e11cb8e (diff) | |
download | org-mode-8b92bcd827f538bb78f79c12378764ab99c689a5.tar.gz |
org: Enable org-show-entry before first heading
* lisp/org.el (org-show-entry): Before first heading show the region
up to the first heading. Remove the now useless ignore-errors.
This behavior allows to reveal invisible text before the first
heading.
-rw-r--r-- | lisp/org.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/org.el b/lisp/org.el index adf0c18..e16f2b3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5966,22 +5966,21 @@ open and agenda-wise Org files." ;;;; Headlines visibility (defun org-show-entry () - "Show the body directly following this heading. + "Show the body directly following its heading. Show the heading too, if it is currently invisible." (interactive) (save-excursion - (ignore-errors - (org-back-to-heading t) - (org-flag-region - (line-end-position 0) - (save-excursion - (if (re-search-forward - (concat "[\r\n]\\(" org-outline-regexp "\\)") nil t) - (match-beginning 1) - (point-max))) - nil - 'outline) - (org-cycle-hide-drawers 'children)))) + (org-back-to-heading-or-point-min t) + (org-flag-region + (line-end-position 0) + (save-excursion + (if (re-search-forward + (concat "[\r\n]\\(" org-outline-regexp "\\)") nil t) + (match-beginning 1) + (point-max))) + nil + 'outline) + (org-cycle-hide-drawers 'children))) (defun org-show-children (&optional level) "Show all direct subheadings of this heading. |