From c3810f71b6fdb4b048636b9b924303ae1e0440b4 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 17 Apr 2014 09:18:08 +0200 Subject: [PATCH] org.el (org-update-dblock): Use `save-excursion' * org.el (org-update-dblock): Use `save-excursion' instead of `save-window-excursion' so that blocks can edit other windows and change the window layout. Thanks to Martin for reporting this. --- lisp/org.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index c5274e1c9..3c7afd20d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11934,8 +11934,9 @@ blocks in the buffer." This means to empty the block, parse for parameters and then call the correct writing function." (interactive) - (save-window-excursion - (let* ((pos (point)) + (save-excursion + (let* ((win (selected-window)) + (pos (point)) (line (org-current-line)) (params (org-prepare-dblock)) (name (plist-get params :name)) @@ -11948,6 +11949,7 @@ the correct writing function." (when (and indent (> indent 0)) (setq indent (make-string indent ?\ )) (save-excursion + (select-window win) (org-beginning-of-dblock) (forward-line 1) (while (not (looking-at org-dblock-end-re))