diff options
author | Bastien Guerry <bzg@altern.org> | 2014-05-15 11:11:43 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2014-05-15 11:11:43 +0200 |
commit | 736bc7b9047600a690a4c00c2a6510fff5044e1f (patch) | |
tree | 52eaa3680323708826d67ffbdfd7a3ee72b12edd | |
parent | 089a13b2f3a107aac9df57b109b3bdd9aac0f3a4 (diff) | |
download | org-mode-736bc7b9047600a690a4c00c2a6510fff5044e1f.tar.gz |
org.el (org-overview): Don't call `recenter'
* org.el (org-overview): Don't call `recenter'.
Thanks to Nicolas Richard for suggesting this.
-rw-r--r-- | lisp/org.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/org.el b/lisp/org.el index c16fab0..2661686 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6974,21 +6974,20 @@ With a numeric prefix, show all headlines up to that level." ;; buffers, where outline-regexp is needed. (defun org-overview () "Switch to overview mode, showing only top-level headlines. -Really, this shows all headlines with level equal or greater than the level +This shows all headlines with a level equal or greater than the level 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 ((pos (point)) - (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)) - (recenter '(4)) - (goto-char pos))) + (save-excursion + (let ((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))))) (defun org-content (&optional arg) "Show all headlines in the buffer, like a table of contents. |