Browse Source

org-src.el (org-edit-src-exit): Don't modify the undo list when inserting the code

* org-src.el (org-edit-src-exit): Don't modify the undo list when
inserting the code.
Aaron Ecay 12 years ago
parent
commit
50226db65d
1 changed files with 6 additions and 5 deletions
  1. 6 5
      lisp/org-src.el

+ 6 - 5
lisp/org-src.el

@@ -737,11 +737,12 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
       (kill-buffer buffer))
     (goto-char beg)
     (when allow-write-back-p
-      (delete-region beg (max beg end))
-      (unless (string-match "\\`[ \t]*\\'" code)
-	(insert code))
-      (goto-char beg)
-      (if single (just-one-space)))
+      (let ((buffer-undo-list t))
+	(delete-region beg (max beg end))
+	(unless (string-match "\\`[ \t]*\\'" code)
+	  (insert code))
+	(goto-char beg)
+	(if single (just-one-space))))
     (if (memq t (mapcar (lambda (overlay)
 			  (eq (overlay-get overlay 'invisible)
 			      'org-hide-block))