Procházet zdrojové kódy

Do not record undo information when adding/remove text properties

When this is done inside org-unmodified, undo information is not recorded.
Carsten Dominik před 15 roky
rodič
revize
6a722e5d2e
2 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 3 0
      lisp/ChangeLog
  2. 4 2
      lisp/org-macs.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-08-03  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-macs.el (org-unmodified): Turn off recording undo
+	information while running inside the macro.
+
 	* org-indent.el (org-hide-leading-stars-before-indent-mode): New
 	variable.
 	(org-indent-mode): Remember and restore value of

+ 4 - 2
lisp/org-macs.el

@@ -44,10 +44,12 @@
   `(and (boundp (quote ,var)) ,var))
 
 (defmacro org-unmodified (&rest body)
-  "Execute body without changing `buffer-modified-p'."
+  "Execute body without changing `buffer-modified-p'.
+Also, do not record undo information."
   `(set-buffer-modified-p
     (prog1 (buffer-modified-p)
-      (let (before-change-functions after-change-functions)
+      (let ((buffer-undo-list t)
+	    before-change-functions after-change-functions)
 	,@body))))
 
 (defmacro org-re (s)