Author: sasugaanija
Date: Mon Sep 3 06:59:17 2007
New Revision: 4936
Modified:
trunk/emacs/uim.el
Log:
* emacs/uim.el
- (uim-process-agent-output)
- Fix Bug: On Emacs-22, the cursor moves to buggy position when
calling undo command after inputting some characters by
uim-input-pad-ja.
Modified: trunk/emacs/uim.el
==============================================================================
--- trunk/emacs/uim.el (original)
+++ trunk/emacs/uim.el Mon Sep 3 06:59:17 2007
@@ -1347,14 +1347,22 @@
(setq buffer-undo-list nil)
(buffer-enable-undo))
- (insert x)
- (uim-debug (format "insert %s" x))
+ (let ((buffer-undo-list-tmp buffer-undo-list))
+ (unwind-protect
+ (progn
+ (setq buffer-undo-list nil)
+ (insert x)
+ (uim-debug (format "insert %s" x)))
+ (when buffer-undo-list
+ (setq buffer-undo-list
+ (uim-delete-atom buffer-undo-list))
+ (setq buffer-undo-list (cons nil buffer-undo-list))
+ (setq buffer-undo-list
+ (append buffer-undo-list buffer-undo-list-tmp)))))
;; disable buffer-undo temporarily
(when uim-buffer-undo-list-saved
- (setq buffer-undo-list (uim-delete-atom buffer-undo-list))
-
(setq uim-buffer-undo-list
(append buffer-undo-list uim-buffer-undo-list))
(setq buffer-undo-list nil)