changeset 36532:3acc5c0fdb1d

(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.
author Kenichi Handa <handa@m17n.org>
date Mon, 05 Mar 2001 11:36:58 +0000
parents aa4662e29968
children 4d2cb95317fd
files lisp/international/quail.el
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Mon Mar 05 11:30:18 2001 +0000
+++ b/lisp/international/quail.el	Mon Mar 05 11:36:58 2001 +0000
@@ -127,7 +127,22 @@
   (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))