瀏覽代碼

org-colview: Do not move point when initializing columns

* lisp/org-colview.el (org-columns): Do not move point.

Reported-by: Benjamin Motz <benni.motz@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00040.html>
Nicolas Goaziou 6 年之前
父節點
當前提交
445dc6af6f
共有 1 個文件被更改,包括 11 次插入11 次删除
  1. 11 11
      lisp/org-colview.el

+ 11 - 11
lisp/org-colview.el

@@ -808,17 +808,17 @@ view for the whole buffer unconditionally.
 When COLUMNS-FMT-STRING is non-nil, use it as the column format."
   (interactive "P")
   (org-columns-remove-overlays)
-  (when global (goto-char (point-min)))
-  (if (markerp org-columns-begin-marker)
-      (move-marker org-columns-begin-marker (point))
-    (setq org-columns-begin-marker (point-marker)))
-  (org-columns-goto-top-level)
-  ;; Initialize `org-columns-current-fmt' and
-  ;; `org-columns-current-fmt-compiled'.
-  (let ((org-columns--time (float-time (current-time))))
-    (org-columns-get-format columns-fmt-string)
-    (unless org-columns-inhibit-recalculation (org-columns-compute-all))
-    (save-excursion
+  (save-excursion
+    (when global (goto-char (point-min)))
+    (if (markerp org-columns-begin-marker)
+	(move-marker org-columns-begin-marker (point))
+      (setq org-columns-begin-marker (point-marker)))
+    (org-columns-goto-top-level)
+    ;; Initialize `org-columns-current-fmt' and
+    ;; `org-columns-current-fmt-compiled'.
+    (let ((org-columns--time (float-time (current-time))))
+      (org-columns-get-format columns-fmt-string)
+      (unless org-columns-inhibit-recalculation (org-columns-compute-all))
       (save-restriction
 	(when (and (not global) (org-at-heading-p))
 	  (narrow-to-region (point) (org-end-of-subtree t t)))