Subject: bug#52245: Wishlist: cycle input methods

From: Eli Zaretskii <[email-masked]>
Date: Wed, 08 Dec 2021 15:26:05 +0200

> From: Robert Pluim <[email-masked]>
> Cc: [email-masked],  [email-masked],
>   [email-masked]
> Date: Wed, 08 Dec 2021 10:40:01 +0100
> 
>     Eli> The use case that I have in mind is this: even if the user customized
>     Eli> the list of input methods to include more than just one, there could
>     Eli> be situations where the user needs to use just one input method when
>     Eli> typing.  In such situations, it would be good to have a way of
>     Eli> toggling, like we do now, instead of cycling through all the other
>     Eli> methods.
> 
>     Eli> Any reasonable solution to this use case would be welcome.  I'm
>     Eli> working with systems which allow you to do something like that, and it
>     Eli> frequently annoys me to have to cycle through all the keyboard layouts
>     Eli> I defined, just to be able to toggle between US English and some other
>     Eli> language.  So I wish that Emacs didn't have such an annoying problem,
>     Eli> if possible.
> 
> Hmm, so how about:
> 
> - default-input-method is an atom
>   ⇒ C-\ behaves as a toggle
> 
> - default-input method is a list
>   ⇒ C-\ cycles through them and back to nil
>   ⇒ C-\ with a prefix arg behaves as today, prompting
>     for an input method. C-\ again deactivates the input method

Sounds good, but I don't understand how you will pull out the trick in
the last sentence.  How will Emacs know to "just deactivate" instead
of cycling?