瀏覽代碼

org.el (org-overview): Don't call `recenter'

* org.el (org-overview): Don't call `recenter'.

Thanks to Nicolas Richard for suggesting this.
Bastien Guerry 11 年之前
父節點
當前提交
b88c5464db
共有 1 個文件被更改,包括 10 次插入11 次删除
  1. 10 11
      lisp/org.el

+ 10 - 11
lisp/org.el

@@ -6907,21 +6907,20 @@ With a numeric prefix, show all headlines up to that level."
 ;; buffers, where outline-regexp is needed.
 ;; buffers, where outline-regexp is needed.
 (defun org-overview ()
 (defun org-overview ()
   "Switch to overview mode, showing only top-level headlines.
   "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
 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
 first headline is not level one, then (hide-sublevels 1) gives confusing
 results."
 results."
   (interactive)
   (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)
 (defun org-content (&optional arg)
   "Show all headlines in the buffer, like a table of contents.
   "Show all headlines in the buffer, like a table of contents.