aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-13 00:29:02 +0000
committerRichard M. Stallman1997-08-13 00:29:02 +0000
commit4d5ac029e08067cf789325966302304287f554c7 (patch)
treefebe283b9cf4ed1ee2cde3805a4e42e0db93b60a /lisp
parent215ff18a8d0a27661daac028afb1e6b361329b22 (diff)
downloademacs-4d5ac029e08067cf789325966302304287f554c7.tar.gz
emacs-4d5ac029e08067cf789325966302304287f554c7.zip
(read-input-method-name): Replace INITIAL-INPUT arg with DEFAULT arg.
Substitute it into to the prompt, if it is non-nil. (select-input-method): Call read-input-method-name the new way. (toggle-input-method): Likewise.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/international/mule-cmds.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 925e705d7aa..e6d1d9dd911 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -442,15 +442,16 @@ Arguments to ACTIVATE-FUNC are INPUT-METHOD and ARGs."
442 (setq slot (cons input-method info)) 442 (setq slot (cons input-method info))
443 (setq input-method-alist (cons slot input-method-alist))))) 443 (setq input-method-alist (cons slot input-method-alist)))))
444 444
445(defun read-input-method-name (prompt &optional initial-input inhibit-null) 445(defun read-input-method-name (prompt &optional default inhibit-null)
446 "Read a name of input method from a minibuffer prompting with PROMPT. 446 "Read a name of input method from a minibuffer prompting with PROMPT.
447If INITIAL-INPUT is non-nil, insert it in the minibuffer initially. 447If DEFAULT is non-nil, use that as the default,
448 If it is (STRING . POSITION), the initial input 448 and substitute it into PROMPT at the first `%s'.
449 is STRING, but point is placed POSITION characters into the string.
450If INHIBIT-NULL is non-nil, null input signals an error." 449If INHIBIT-NULL is non-nil, null input signals an error."
450 (if default
451 (setq prompt (format prompt default)))
451 (let* ((completion-ignore-case t) 452 (let* ((completion-ignore-case t)
452 (input-method (completing-read prompt input-method-alist 453 (input-method (completing-read prompt input-method-alist
453 nil t initial-input))) 454 nil t nil nil default)))
454 (if (> (length input-method) 0) 455 (if (> (length input-method) 0)
455 input-method 456 input-method
456 (if inhibit-null 457 (if inhibit-null
@@ -486,11 +487,10 @@ This sets both the default and local values of `default-input-method'
486to the input method you specify. 487to the input method you specify.
487See also the function `register-input-method'." 488See also the function `register-input-method'."
488 (interactive 489 (interactive
489 (let* ((default (or previous-input-method default-input-method)) 490 (let* ((default (or previous-input-method default-input-method)))
490 (initial (if default (cons default 0))))
491 (if (not enable-multibyte-characters) 491 (if (not enable-multibyte-characters)
492 (error "Can't activate any input method while enable-multibyte-characters is nil")) 492 (error "Can't activate an input method while multibyte characters are disabled"))
493 (list (read-input-method-name "Input method: " initial t)))) 493 (list (read-input-method-name "Input method (default %s): " default t))))
494 (activate-input-method input-method) 494 (activate-input-method input-method)
495 (setq-default default-input-method default-input-method)) 495 (setq-default default-input-method default-input-method))
496 496
@@ -502,15 +502,14 @@ else turn on the default input method (see `default-input-method').
502In the latter case, if default-input-method is nil, select an input method 502In the latter case, if default-input-method is nil, select an input method
503interactively." 503interactively."
504 (interactive "P") 504 (interactive "P")
505 (let* ((default (or previous-input-method default-input-method)) 505 (let* ((default (or previous-input-method default-input-method)))
506 (initial (if default (cons default 0))))
507 (if (and current-input-method (not arg)) 506 (if (and current-input-method (not arg))
508 (inactivate-input-method) 507 (inactivate-input-method)
509 (if (not enable-multibyte-characters) 508 (if (not enable-multibyte-characters)
510 (error "Can't activate any input method while multibyte characters are disabled")) 509 (error "Can't activate any input method while multibyte characters are disabled"))
511 (activate-input-method 510 (activate-input-method
512 (if (or arg (not default-input-method)) 511 (if (or arg (not default-input-method))
513 (read-input-method-name "Input method: " initial t) 512 (read-input-method-name "Input method (default %s): " default t)
514 default-input-method))))) 513 default-input-method)))))
515 514
516(defun describe-input-method (input-method) 515(defun describe-input-method (input-method)