From: Ted Zlatanov <tzz@lifelogs.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Swapping default input method: why so complicated?
Date: Mon, 15 Nov 2010 09:42:57 -0600 [thread overview]
Message-ID: <87zktabnjy.fsf@lifelogs.com> (raw)
In-Reply-To: slrnie1qk2.fui.nospam-abuse@powdermilk.math.berkeley.edu
On Mon, 15 Nov 2010 08:08:34 +0000 (UTC) Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
IZ> I'm trying to do what I consider a very typical requirement: swap two
IZ> values of default input method. Unfortunately, I could not find any
IZ> documented solution (outside of info-manuals, just using f1 v and f1
IZ> f). To get it working, I was forced to inspect the sources... Is
IZ> there a simpler solution?
IZ> (defun my-cyr-switch-input-method ()
IZ> "Switch cyrillic input method between cyrillic-yawerty and cyrillic-jcuken."
IZ> (interactive)
IZ> (let (n (o (or current-input-method
IZ> (car input-method-history)
IZ> default-input-method))
IZ> (c current-input-method))
IZ> (setq n (if (equal o "cyrillic-yawerty")
IZ> "cyrillic-jcuken"
IZ> "cyrillic-yawerty"))
IZ> (set-input-method n)
IZ> (or c (set-input-method nil))
IZ> (message "Toggled default input method to \"%s\"; toggle on/off by Ctrl-\\" n)))
I usually use `C-u M-x toggle-input-method' which queries and has a
history of past choices. But it would be nice if there was a
`cycle-input-method' that cycled among several choices (or,
alternatively, `default-input-method' could be allowed to be a list and
then `toggle-input-method' could select the first element of the list
and then rotate the list).
Ted
next parent reply other threads:[~2010-11-15 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <slrnie1qk2.fui.nospam-abuse@powdermilk.math.berkeley.edu>
2010-11-15 15:42 ` Ted Zlatanov [this message]
[not found] ` <slrnie37cq.i9q.nospam-abuse@powdermilk.math.berkeley.edu>
[not found] ` <87fwv170n4.fsf@lifelogs.com>
2010-11-17 9:57 ` Swapping default input method: why so complicated? Ilya Zakharevich
2010-11-17 15:19 ` Ted Zlatanov
[not found] ` <874obiofmc.fsf@kuiper.lan.informatimago.com>
2010-11-15 21:15 ` Ted Zlatanov
2010-11-17 2:36 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zktabnjy.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.