summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-05-15 11:11:43 +0200
committerBastien Guerry <bzg@altern.org>2014-06-10 16:20:47 +0200
commitb88c5464db2cb0d90d4f30e43b5e08d2b1c1fcea (patch)
tree17475159bc0c37ab0ffd77ad288fc5932381b2b4
parent8cc4e09950594b2abec2502e9218318570595ac5 (diff)
downloadorg-mode-b88c5464db2cb0d90d4f30e43b5e08d2b1c1fcea.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.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 6eee9c0..14a35c0 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6907,21 +6907,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.