help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Swapping default input method: why so complicated?


From: Pascal J. Bourguignon
Subject: Re: Swapping default input method: why so complicated?
Date: Wed, 08 Dec 2010 15:36:06 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:

> I'm trying to do what I consider a very typical requirement: swap two
> values of default input method.  Unfortunately, I could not find any
> documented solution (outside of info-manuals, just using f1 v and f1
> f).  To get it working, I was forced to inspect the sources...  Is
> there a simpler solution?

What is complicated in typing  C-\  which is bound to
toggle-input-method by default?

You just use:

   M-x set-input-method RET cyrillic-yawerty RET
   M-x set-input-method RET cyrillic-jcuken RET

to select your two input methods, and then type C-\


If you don't want to type the two set-input-method above, you can put
them in your ~/.emacs:

    (set-input-method "cyrillic-yawerty")
    (set-input-method "cyrillic-jcuken")


> (defun my-cyr-switch-input-method ()
>   "Switch cyrillic input method between cyrillic-yawerty and cyrillic-jcuken."
>   (interactive)
>   (let (n (o (or current-input-method
>                  (car input-method-history)
>                  default-input-method))
>           (c current-input-method))
>     (setq n (if (equal o "cyrillic-yawerty")
>                 "cyrillic-jcuken"
>               "cyrillic-yawerty"))
>     (set-input-method n)
>     (or c (set-input-method nil))
>     (message "Toggled default input method to \"%s\"; toggle on/off by 
> Ctrl-\\" n)))
>
> Thanks,
> Ilya
>
> P.S.  I suspect it is 23.1 - but I found no easy way to find the emacs
>       version using the f1 help system - printing f1 f1 gives no hints...
>
>       Hmm, no, directly inspecting the varaible it is 21.4.  This may
>       explain why the situation is so ugly, I remember seeing many
>       improvements in internationalization in 23 and 22.   Anyway, I
>       need a solution working with older Emacsen...
>

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


reply via email to

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