changeset 19555:df2996f7fdc3

(inactivate-current-input-method-function): Doc-string modified. (input-method-activate-hook): Likewise. (input-method-inactivate-hook): Likewise. (activate-input-method): Document it. (inactivate-input-method): Document it.
author Kenichi Handa <handa@m17n.org>
date Tue, 26 Aug 1997 12:03:42 +0000
parents dba381533ebc
children b21c14f05753
files lisp/international/mule-cmds.el
diffstat 1 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Tue Aug 26 11:47:06 1997 +0000
+++ b/lisp/international/mule-cmds.el	Tue Aug 26 12:03:42 1997 +0000
@@ -399,7 +399,10 @@
 (defvar inactivate-current-input-method-function nil
   "Function to call for inactivating the current input method.
 Every input method should set this to an appropriate value when activated.
-This function is called with no argument.")
+This function is called with no argument.
+
+This function should never change the value of `current-input-method'.
+It is set to nil by the function `inactivate-input-method'.")
 (make-variable-buffer-local 'inactivate-current-input-method-function)
 (put 'inactivate-current-input-method-function 'permanent-local t)
 
@@ -450,8 +453,9 @@
       (if inhibit-null
 	  (error "No valid input method is specified")))))
 
-;; Activate INPUT-METHOD.
 (defun activate-input-method (input-method)
+  "Turn INPUT-METHOD on.
+If some input method is already on, turn it off at first."
   (if (and current-input-method
 	   (not (string= current-input-method input-method)))
     (inactivate-input-method))
@@ -464,8 +468,8 @@
       (setq current-input-method-title (nth 3 slot))
       (run-hooks 'input-method-activate-hook))))
 
-;; Inactivate the current input method.
 (defun inactivate-input-method ()
+  "Turn off the current input method."
   (when current-input-method
     (if input-method-history
 	(unless (string= current-input-method (car input-method-history))
@@ -554,9 +558,11 @@
 	(or input-method
 	    default-input-method
 	    (read-input-method-name "Input method: " nil t)))
-  (let ((minibuffer-setup-hook
-	 (function (lambda () (activate-input-method input-method)))))
-    (read-string prompt initial-input)))
+  (let ((current-input-method
+	 (or input-method
+	     default-input-method
+	     (read-input-method-name "Input method: " nil t))))
+    (read-string prompt initial-input nil nil t)))
 
 ;; Variables to control behavior of input methods.  All input methods
 ;; should react to these variables.
@@ -578,10 +584,16 @@
   :group 'mule)
 
 (defvar input-method-activate-hook nil
-  "Normal hook run just after an input method is activated.")
+  "Normal hook run just after an input method is activated.
+
+The variable `current-input-method' keeps the input method name
+just activated.")
 
 (defvar input-method-inactivate-hook nil
-  "Normal hook run just after an input method is inactivated.")
+  "Normal hook run just after an input method is inactivated.
+
+The variable `current-input-method' still keeps the input method name
+just inacitvated.")
 
 (defvar input-method-after-insert-chunk-hook nil
   "Normal hook run just after an input method insert some chunk of text.")