unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
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


       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

  List information: https://www.gnu.org/software/emacs/

* 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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).