[uim-commit] r3115 - trunk/emacs

nosuke at freedesktop.org nosuke at freedesktop.org
Fri Feb 17 12:22:20 PST 2006


Author: nosuke
Date: 2006-02-17 12:22:10 -0800 (Fri, 17 Feb 2006)
New Revision: 3115

Modified:
   trunk/emacs/uim.el
Log:
* emacs/uim.el
  - Fix problem that buffer's first modified history is not
   recorded onto buffer-undo-list.



Modified: trunk/emacs/uim.el
===================================================================
--- trunk/emacs/uim.el	2006-02-17 20:10:41 UTC (rev 3114)
+++ trunk/emacs/uim.el	2006-02-17 20:22:10 UTC (rev 3115)
@@ -1148,15 +1148,31 @@
 	  (mapcar
 	   '(lambda (x) 
 		(let ((start (point)))
+		  
+		  ;; enable buffer-undo temporarily
+		  (when uim-buffer-undo-list-saved
+		    (setq buffer-undo-list nil)
+		    (buffer-enable-undo))
+
 	      (insert x)
 	      (uim-debug (format "insert %s" x))
 
-		  ;; append undo info to saved buffer-undo-list
-		  (if uim-buffer-undo-list-saved
+		  ;; disable buffer-undo temporarily
+		  (when uim-buffer-undo-list-saved
+		    (let (delatom)
+		      (defun delatom (x)
+			(if (and x (not (atom x)))
+			    (if (and (car x) (atom (car x)))
+				(delatom (cdr x))
+			      (cons (car x) (delatom (cdr x))))
+			  x))
+		      (setq buffer-undo-list (delatom buffer-undo-list))
+		      )
+
 		      (setq uim-buffer-undo-list
-			    (cons nil
-				  (cons (cons start (point))
-					uim-buffer-undo-list))))
+			  (append buffer-undo-list uim-buffer-undo-list))
+		    (setq buffer-undo-list nil)
+		    (buffer-disable-undo))
 		  )
 		)
 	   commit)



More information about the uim-commit mailing list