浏览代码

org-src.el: Save and restore `buffer-undo-list' after editing.

* org-src.el (org-src-in-org-buffer): Save and restore
`buffer-undo-list' after editing.

Thanks to Peter Danenberg for this fix.
Bastien Guerry 13 年之前
父节点
当前提交
cc7acb65ff
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lisp/org-src.el

+ 2 - 1
lisp/org-src.el

@@ -661,7 +661,7 @@ the language, a switch telling if the content should be in a single line."
       (setq org-edit-src-saved-temp-window-config nil))))
 
 (defmacro org-src-in-org-buffer (&rest body)
-  `(let ((p (point)) (m (mark)) msg)
+  `(let ((p (point)) (m (mark)) (ul buffer-undo-list) msg)
      (save-window-excursion
        (org-edit-src-exit 'save)
        ,@body
@@ -670,6 +670,7 @@ the language, a switch telling if the content should be in a single line."
 	   (let ((org-src-window-setup 'current-window))
 	     (org-edit-src-code 'save))
 	 (org-edit-src-code 'save)))
+     (setq buffer-undo-list ul)
      (push-mark m 'nomessage)
      (goto-char (min p (point-max)))
      (message (or msg ""))))