aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-07 20:50:48 +0000
committerRichard M. Stallman1998-05-07 20:50:48 +0000
commit7ddbb5bc208246cba3997d6d61749448b25260ae (patch)
treea6421c48cd90ddc1e32c120e6baa7331cdf35288
parenta458d45d9e78325248ce81695de2bda8b1ed3e1e (diff)
downloademacs-7ddbb5bc208246cba3997d6d61749448b25260ae.tar.gz
emacs-7ddbb5bc208246cba3997d6d61749448b25260ae.zip
(toggle-input-method): Use a more
appropriate default value while reading an input method.
-rw-r--r--lisp/international/mule-cmds.el27
1 files changed, 17 insertions, 10 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8537c654a4a..305bf256a61 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -687,22 +687,29 @@ and turn it on for the current buffer."
687(defun toggle-input-method (&optional arg) 687(defun toggle-input-method (&optional arg)
688 "Turn on or off a multilingual text input method for the current buffer. 688 "Turn on or off a multilingual text input method for the current buffer.
689 689
690With arg, read an input method from minibuffer and turn it on. 690With no prefix argument, if some input method is currently activated,
691turn it off. Otherwise, activate an input method--the one most recently used,
692or the one specified in `default-input-method', or one read from the
693minibuffer.
691 694
692Without arg, if some input method is currently activated, turn it off, 695With a prefix arg, read an input method from minibuffer and turn it on.
693else turn on an input method selected last time 696The default is the most recent input method specified
694or the default input method (see `default-input-method'). 697\(not including the currently active input method, if any).
695 698
696When there's no input method to turn on, turn on what read from minibuffer." 699When there's no input method to turn on, turn on what read from minibuffer."
697 (interactive "P") 700 (interactive "P")
698 (let* ((default (or (car input-method-history) default-input-method))) 701 (if (and current-input-method (not arg))
699 (if (and current-input-method (not arg)) 702 (inactivate-input-method)
700 (inactivate-input-method) 703 (let ((default (or (car input-method-history) default-input-method)))
704 (if (and arg default (equal current-input-method default)
705 (> (length input-method-history) 1))
706 (setq default (nth 1 input-method-history)))
701 (activate-input-method 707 (activate-input-method
702 (if (or arg (not default)) 708 (if (or arg (not default))
703 (read-input-method-name 709 (progn
704 (if default "Input method (default %s): " "Input method: " ) 710 (read-input-method-name
705 default t) 711 (if default "Input method (default %s): " "Input method: " )
712 default t))
706 default)) 713 default))
707 (or default-input-method 714 (or default-input-method
708 (setq default-input-method current-input-method))))) 715 (setq default-input-method current-input-method)))))