From 423957633969a4c056a066b6cba3bb0018af4163 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 18 Aug 1997 02:28:28 +0000 Subject: [PATCH] (toggle-input-method) (select-input-method): Always set default-input-method. Show default in the prompt only if there is one. (activate-input-method): Handle the new rule that default-input-method is now global only. (input-method-verbose-flag): Renamed from input-method-tersely-flag and sense inverted. (input-method-highlight-flag): New variable. (toggle-input-method): Pass missing arg to read-input-method-name. --- lisp/international/mule-cmds.el | 51 +++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 62c4e5727c6..9ccd32fe6ff 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -455,20 +455,17 @@ If INHIBIT-NULL is non-nil, null input signals an error." ;; Actvate INPUT-METHOD. (defun activate-input-method (input-method) - (if (and current-input-method - (not (string= current-input-method input-method))) - (inactivate-input-method)) - (if current-input-method - nil ; We have nothing to do. + (when (and current-input-method + (not (string= current-input-method input-method))) + (setq previous-input-method current-input-method) + (inactivate-input-method)) + (unless current-input-method (let ((slot (assoc input-method input-method-alist))) (if (null slot) (error "Invalid input method `%s'" input-method)) (apply (nth 2 slot) input-method (nthcdr 5 slot)) (setq current-input-method input-method) - (setq current-input-method-title (nth 3 slot)) - (if (not (string= default-input-method current-input-method)) - (setq previous-input-method default-input-method - default-input-method current-input-method))))) + (setq current-input-method-title (nth 3 slot))))) ;; Inactivate the current input method. (defun inactivate-input-method () @@ -486,9 +483,13 @@ See also the function `register-input-method'." (let* ((default (or previous-input-method default-input-method))) (if (not enable-multibyte-characters) (error "Can't activate an input method while multibyte characters are disabled")) - (list (read-input-method-name "Input method (default %s): " default t)))) + (list (read-input-method-name + (if default + (format "Input method (default %s): " default) + "Input method: ") + default t)))) (activate-input-method input-method) - (setq-default default-input-method default-input-method)) + (setq default-input-method input-method)) (defun toggle-input-method (&optional arg) "Turn on or off a multilingual text input method for the current buffer. @@ -503,10 +504,14 @@ interactively." (inactivate-input-method) (if (not enable-multibyte-characters) (error "Can't activate any input method while multibyte characters are disabled")) - (activate-input-method - (if (or arg (not default-input-method)) - (read-input-method-name "Input method (default %s): " default t) - default-input-method))))) + (if (or arg (not default-input-method)) + (setq default-input-method + (read-input-method-name + (if default + (format "Input method (default %s): " default) + "Input method: ") + default t))) + (activate-input-method default-input-method)))) (defun describe-input-method (input-method) "Describe the current input method." @@ -552,11 +557,21 @@ to be activated instead of the one selected last time." ;; Variables to control behavior of input methods. All input methods ;; should react to these variables. -(defvar input-method-tersely-flag nil - "*If this flag is non-nil, input method works rather tersely. +(defcustom input-method-verbose-flag t + "*If this flag is non-nil, input methods give extra guidance. For instance, Quail input method does not show guidance buffer while -inputting at minibuffer if this flag is t.") +inputting at minibuffer if this flag is t." + :type 'boolean + :group 'mule) + +(defcustom input-method-highlight-flag t + "*If this flag is non-nil, input methods highlight partially-entered text. +For instance, while you are in the middle of a Quail input method sequence, +the text inserted so far is temporarily underlined. +The underlining goes away when you finish or abort the input method sequence." + :type 'boolean + :group 'mule) (defvar input-method-activate-hook nil "Normal hook run just after an input method is activated.") -- 2.39.5