[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding consistent extra symbols to input methods (cyrillic-*, croati

From: Kenichi Handa
Subject: Re: adding consistent extra symbols to input methods (cyrillic-*, croatian-*, slov*, czech-* etc.) input methods
Date: Sat, 05 Jul 2008 21:54:21 +0900

In article <address@hidden>, Ted Zlatanov <address@hidden> writes:

> Right, I'm trying to do the above for input methods that are in
> input-method-alist but not necessarily loaded.  So this works:

> (dolist (method 
>        (remove nil
>                (mapcar 
>                 (lambda(m) 
>                   (let ((name (car-safe m)))
>                     (when (and (string-match "cyrillic" name)
>                                (quail-package name))
>                       name)))
>                 input-method-alist)))
>   (message "Defining rules for method %s" method)
>   (quail-defrule ",," ?„ method))

> The question is, should I load those input methods explicitly, or just
> assume that it's enough to handle what's in leim/quail/cyrillic.el?

You can't assume that all "cyrillic*" input methods are in
leim/quail/cyrillic.el.  So the safest (and more efficient)
way is something like this:

(mapc (lambda(m) 
        (let ((name (car m)))
          (when (string-match "cyrillic" name)
            (message "Defining rules for method %s" method)
            (activate-input-method name)
            (quail-defrule ",," ?„)

But, I'm now thiking about introducing this variable to
avoid eval-after-load in leim-ext.el:

(defvar quail-additional-rule-alist nil
  "Alist of Quail package names vs. the rules to add after loading the package.
Each element has the form (PACKAGE-NAME RULE ...), where
PACKAGE-NAME is a Quail package name (string representing an input method),
and RULE is a translation rule of the form (KEY TRANSLATION APPEND).
See the documentaion of the function `quail-defrule' for the meanings

With this, you can do: 

(mapc (lambda(m) 
        (let ((name (car m)))
          (when (string-match "cyrillic" name)
            (message "Defining rules for method %s" method)
            (push (list name '(",," ?„)) quail-additional-rule-alist))))

> Specifically, cyrillic-jis-russian wouldn't be handled this way, and it
> can benefit from the extended mappings I am creating (proper double
> quotes „ “, single quotes ‚‘ and the № § « » symbols).  If I should
> special-case it in leim-ext.el that's fine, I'm just trying to approach
> it programmatically.  

I think cyrillic-jis-russian is now obsolete because all
Cyrillic character in JIS are now unified into Unicode.

Kenichi Handa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]