From 341cd4f01db7f40a32c29d4c64741128d11b54c3 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 5 Mar 2001 11:37:33 +0000 Subject: [PATCH] (quail-title): Fix for the case that a title of an input method is specified by a list of the same form as used in mode-line-format. --- lisp/ChangeLog | 4 ++++ lisp/international/quail.el | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 47b890b69f5..6a5d0e4aefb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2001-03-05 Kenichi Handa + * international/quail.el (quail-title): Fix for the case that a + title of an input method is specified by a list of the same form + as used in mode-line-format. + * international/mule-cmds.el (activate-input-method): If current-input-method-title is set by activating INPUT-METHOD, respect that value. diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 6d26a01aa35..54712c31dcd 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -127,7 +127,22 @@ See the documentation of `quail-define-package' for the other elements.") (nth 0 quail-current-package)) (defsubst quail-title () "Return the title of the current Quail package." - (nth 1 quail-current-package)) + (let ((title (nth 1 quail-current-package))) + ;; TITLE may be a string or a list. If it is a list, each element + ;; is a string or the form (VAR STR1 STR2), and the interpretation + ;; of the list is the same as that of mode-line-format. + (if (stringp title) + title + (condition-case nil + (mapconcat + (lambda (x) + (cond ((stringp x) x) + ((and (listp x) (symbolp (car x)) (= (length x) 3)) + (if (symbol-value (car x)) + (nth 1 x) (nth 2 x))) + (t ""))) + title "") + (error ""))))) (defsubst quail-map () "Return the translation map of the current Quail package." (nth 2 quail-current-package)) -- 2.39.5