Ver Fonte

org-table.el (org-table-align): Only set the window start when table alignment is performed in the selected window

* org-table.el (org-table-align): Only set the window start
when table alignment is performed in the selected window.

Thanks to Michael Brand for reporting this.

When opening an .org file from another .org file, org-mode
is initialized in the second one while the window is not yet
selected.  So, functions run during org-mode's initialization
need to check if the org-mode window is the selected one before
manipulating the "current window".
Bastien Guerry há 12 anos atrás
pai
commit
adcc0d414b
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      lisp/org-table.el

+ 2 - 1
lisp/org-table.el

@@ -921,7 +921,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
     (org-goto-line winstartline)
     (setq winstart (point-at-bol))
     (org-goto-line linepos)
-    (set-window-start (selected-window) winstart 'noforce)
+    (when (eq (window-buffer (selected-window)) (current-buffer))
+      (set-window-start (selected-window) winstart 'noforce))
     (org-table-goto-column colpos)
     (and org-table-overlay-coordinates (org-table-overlay-coordinates))
     (setq org-table-may-need-update nil)