[uim-commit] r3114 - trunk/emacs
nosuke at freedesktop.org
nosuke at freedesktop.org
Fri Feb 17 12:10:45 PST 2006
Author: nosuke
Date: 2006-02-17 12:10:41 -0800 (Fri, 17 Feb 2006)
New Revision: 3114
Modified:
trunk/emacs/uim-leim.el
trunk/emacs/uim-var.el
trunk/emacs/uim.el
Log:
* emacs/uim-leim.el
* emacs/uim-var.el
* emacs/uim.el
- Add a function instead of kill-all-local-variables to
reset only local variables which are provided by uim.el
- Move encoding initializing part to uim-mode-on
to re-initialize encoding when uim-el-agent has been restarted.
Modified: trunk/emacs/uim-leim.el
===================================================================
--- trunk/emacs/uim-leim.el 2006-02-17 18:59:24 UTC (rev 3113)
+++ trunk/emacs/uim-leim.el 2006-02-17 20:10:41 UTC (rev 3114)
@@ -89,6 +89,8 @@
(defun uim-leim-init ()
;; register IM to input-method-alist
;; to display the alist, call list-input-methods
+ (uim-im-init)
+
(mapcar
'(lambda (x)
(let* ((name (car x))
Modified: trunk/emacs/uim-var.el
===================================================================
--- trunk/emacs/uim-var.el 2006-02-17 18:59:24 UTC (rev 3113)
+++ trunk/emacs/uim-var.el 2006-02-17 20:10:41 UTC (rev 3114)
@@ -229,15 +229,21 @@
(defvar uim-retry-keys nil)
+(defvar uim-local-var '())
+
;; Macro for setting up buffer-local variable
(defmacro uim-deflocalvar (var default &optional documentation)
`(progn
(defvar ,var ,default
(format "%s (local\)" ,documentation))
+ (setq uim-local-var (cons (cons ',var ,default) uim-local-var))
(make-variable-buffer-local ',var)))
+;; Encoding initialized flag
+(defvar uim-im-initialized nil)
+
;;; Buffer Local Variables
(uim-deflocalvar uim-mode-line-string " U"
Modified: trunk/emacs/uim.el
===================================================================
--- trunk/emacs/uim.el 2006-02-17 18:59:24 UTC (rev 3113)
+++ trunk/emacs/uim.el 2006-02-17 20:10:41 UTC (rev 3114)
@@ -375,6 +375,14 @@
)
+(defun uim-im-init ()
+ (when (not uim-im-initialized)
+ (uim-init-im-alist)
+ (uim-init-im-encoding)
+ (setq uim-im-initialized t)
+ ))
+
+
;;
;; Activate uim
;;
@@ -386,6 +394,9 @@
(message "uim.el: uim-mode is already activated. (buffer %s)"
(current-buffer)))
+ ;; Initialize IM encoding
+ (uim-im-init)
+
(if (not buffer-read-only)
(progn
@@ -627,6 +638,15 @@
;;
+;; Reset all uim.el buffer local variables
+;;
+(defun uim-init-all-local-var ()
+ (mapcar
+ '(lambda (x)
+ (set (car x) (cdr x)))
+ uim-local-var))
+
+;;
;; Sentinel of uim-el-agent
;; STOP state is not supported yet
;;
@@ -645,7 +665,8 @@
;; disable uim
(uim-force-off)
;; reset all local variables
- (kill-all-local-variables)
+ (uim-init-all-local-var)
+ (setq uim-im-initialized nil)
))
(setq bufs (cdr bufs)))
))
@@ -1269,7 +1290,7 @@
(defun uim-get-im-list ()
(uim-do-send-recv-cmd (format "0 LIST")))
-(defun uim-initialize-im-alist ()
+(defun uim-init-im-alist ()
(uim-get-im-list))
;;
@@ -1277,8 +1298,6 @@
;;
(defun uim-init-im-encoding ()
- (uim-initialize-im-alist)
-
;; set Uim side encoding to agent
(mapcar
'(lambda (x)
@@ -1312,9 +1331,6 @@
;; initialize minor-mode
(uim-init-minor-mode)
- ;; initialize encoding
- (uim-init-im-encoding)
-
;; initialize keymap
(uim-init-keymap)
More information about the uim-commit
mailing list