diff options
author | Bastien Guerry <bzg@altern.org> | 2013-02-26 16:28:30 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-02-26 16:28:30 +0100 |
commit | 2efbd0f138180fe14773d5485ad3c59332d6ddb3 (patch) | |
tree | bd3eedb2827eb1b25d9e20be041bd7578fabf440 | |
parent | 95375260e5c6b3ff6fa306b6effec9098b1ef37b (diff) | |
download | org-mode-2efbd0f138180fe14773d5485ad3c59332d6ddb3.tar.gz |
org.el (org-overview): Stay on current line
* org.el (org-overview): Stay on current line.
This circumvents a bug in hide-sublevels which displays the
"..." ellipsis on top of the window when hiding levels that
are past the middle of the window---at least this is the
way I could understand the problem.
Thanks to Samuel Wales for reporting the problem, Arun Persaud and
William for creating reproducible recipes, Suvayu Ali, Nick Dokos
and Achim Gratz for further help.
-rw-r--r-- | lisp/org.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 45de626..1e3ae57 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6436,13 +6436,16 @@ of the first headline in the buffer. This is important, because if the first headline is not level one, then (hide-sublevels 1) gives confusing results." (interactive) - (let ((level (save-excursion + (let ((l (org-current-line)) + (level (save-excursion (goto-char (point-min)) (if (re-search-forward (concat "^" outline-regexp) nil t) (progn (goto-char (match-beginning 0)) (funcall outline-level)))))) - (and level (hide-sublevels level)))) + (and level (hide-sublevels level)) + (recenter '(4)) + (org-goto-line l))) (defun org-content (&optional arg) "Show all headlines in the buffer, like a table of contents. |