瀏覽代碼

Merge branch 'maint'

Bastien Guerry 11 年之前
父節點
當前提交
06bbbee67a
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      lisp/org.el

+ 4 - 2
lisp/org.el

@@ -12039,8 +12039,9 @@ blocks in the buffer."
 This means to empty the block, parse for parameters and then call
 This means to empty the block, parse for parameters and then call
 the correct writing function."
 the correct writing function."
   (interactive)
   (interactive)
-  (save-window-excursion
-    (let* ((pos (point))
+  (save-excursion
+    (let* ((win (selected-window))
+	   (pos (point))
 	   (line (org-current-line))
 	   (line (org-current-line))
 	   (params (org-prepare-dblock))
 	   (params (org-prepare-dblock))
 	   (name (plist-get params :name))
 	   (name (plist-get params :name))
@@ -12053,6 +12054,7 @@ the correct writing function."
       (when (and indent (> indent 0))
       (when (and indent (> indent 0))
 	(setq indent (make-string indent ?\ ))
 	(setq indent (make-string indent ?\ ))
 	(save-excursion
 	(save-excursion
+	  (select-window win)
 	  (org-beginning-of-dblock)
 	  (org-beginning-of-dblock)
 	  (forward-line 1)
 	  (forward-line 1)
 	  (while (not (looking-at org-dblock-end-re))
 	  (while (not (looking-at org-dblock-end-re))