aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-18 02:28:28 +0000
committerRichard M. Stallman1997-08-18 02:28:28 +0000
commit423957633969a4c056a066b6cba3bb0018af4163 (patch)
tree63a17bae6eb7d714b3af2e7b5f896f6b94444315
parent0eff1f85acea7e81934ed8f34b4e382f4d66aade (diff)
downloademacs-423957633969a4c056a066b6cba3bb0018af4163.tar.gz
emacs-423957633969a4c056a066b6cba3bb0018af4163.zip
(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.
-rw-r--r--lisp/international/mule-cmds.el51
1 files 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."
455 455
456;; Actvate INPUT-METHOD. 456;; Actvate INPUT-METHOD.
457(defun activate-input-method (input-method) 457(defun activate-input-method (input-method)
458 (if (and current-input-method 458 (when (and current-input-method
459 (not (string= current-input-method input-method))) 459 (not (string= current-input-method input-method)))
460 (inactivate-input-method)) 460 (setq previous-input-method current-input-method)
461 (if current-input-method 461 (inactivate-input-method))
462 nil ; We have nothing to do. 462 (unless current-input-method
463 (let ((slot (assoc input-method input-method-alist))) 463 (let ((slot (assoc input-method input-method-alist)))
464 (if (null slot) 464 (if (null slot)
465 (error "Invalid input method `%s'" input-method)) 465 (error "Invalid input method `%s'" input-method))
466 (apply (nth 2 slot) input-method (nthcdr 5 slot)) 466 (apply (nth 2 slot) input-method (nthcdr 5 slot))
467 (setq current-input-method input-method) 467 (setq current-input-method input-method)
468 (setq current-input-method-title (nth 3 slot)) 468 (setq current-input-method-title (nth 3 slot)))))
469 (if (not (string= default-input-method current-input-method))
470 (setq previous-input-method default-input-method
471 default-input-method current-input-method)))))
472 469
473;; Inactivate the current input method. 470;; Inactivate the current input method.
474(defun inactivate-input-method () 471(defun inactivate-input-method ()
@@ -486,9 +483,13 @@ See also the function `register-input-method'."
486 (let* ((default (or previous-input-method default-input-method))) 483 (let* ((default (or previous-input-method default-input-method)))
487 (if (not enable-multibyte-characters) 484 (if (not enable-multibyte-characters)
488 (error "Can't activate an input method while multibyte characters are disabled")) 485 (error "Can't activate an input method while multibyte characters are disabled"))
489 (list (read-input-method-name "Input method (default %s): " default t)))) 486 (list (read-input-method-name
487 (if default
488 (format "Input method (default %s): " default)
489 "Input method: ")
490 default t))))
490 (activate-input-method input-method) 491 (activate-input-method input-method)
491 (setq-default default-input-method default-input-method)) 492 (setq default-input-method input-method))
492 493
493(defun toggle-input-method (&optional arg) 494(defun toggle-input-method (&optional arg)
494 "Turn on or off a multilingual text input method for the current buffer. 495 "Turn on or off a multilingual text input method for the current buffer.
@@ -503,10 +504,14 @@ interactively."
503 (inactivate-input-method) 504 (inactivate-input-method)
504 (if (not enable-multibyte-characters) 505 (if (not enable-multibyte-characters)
505 (error "Can't activate any input method while multibyte characters are disabled")) 506 (error "Can't activate any input method while multibyte characters are disabled"))
506 (activate-input-method 507 (if (or arg (not default-input-method))
507 (if (or arg (not default-input-method)) 508 (setq default-input-method
508 (read-input-method-name "Input method (default %s): " default t) 509 (read-input-method-name
509 default-input-method))))) 510 (if default
511 (format "Input method (default %s): " default)
512 "Input method: ")
513 default t)))
514 (activate-input-method default-input-method))))
510 515
511(defun describe-input-method (input-method) 516(defun describe-input-method (input-method)
512 "Describe the current input method." 517 "Describe the current input method."
@@ -552,11 +557,21 @@ to be activated instead of the one selected last time."
552;; Variables to control behavior of input methods. All input methods 557;; Variables to control behavior of input methods. All input methods
553;; should react to these variables. 558;; should react to these variables.
554 559
555(defvar input-method-tersely-flag nil 560(defcustom input-method-verbose-flag t
556 "*If this flag is non-nil, input method works rather tersely. 561 "*If this flag is non-nil, input methods give extra guidance.
557 562
558For instance, Quail input method does not show guidance buffer while 563For instance, Quail input method does not show guidance buffer while
559inputting at minibuffer if this flag is t.") 564inputting at minibuffer if this flag is t."
565 :type 'boolean
566 :group 'mule)
567
568(defcustom input-method-highlight-flag t
569 "*If this flag is non-nil, input methods highlight partially-entered text.
570For instance, while you are in the middle of a Quail input method sequence,
571the text inserted so far is temporarily underlined.
572The underlining goes away when you finish or abort the input method sequence."
573 :type 'boolean
574 :group 'mule)
560 575
561(defvar input-method-activate-hook nil 576(defvar input-method-activate-hook nil
562 "Normal hook run just after an input method is activated.") 577 "Normal hook run just after an input method is activated.")