From: Robert Pluim <rpluim@gmail.com>
To: "André A. Gomes" <andremegafone@gmail.com>
Cc: Tor Kringeland <tor.a.s.kringeland@ntnu.no>, 52173@debbugs.gnu.org
Subject: bug#52173: `ś' character not available using `C-x 8'
Date: Mon, 29 Nov 2021 17:52:46 +0100 [thread overview]
Message-ID: <875ysa6h0h.fsf@gmail.com> (raw)
In-Reply-To: <87k0grardn.fsf@gmail.com> ("André A. Gomes"'s message of "Mon, 29 Nov 2021 15:55:16 +0000")
>>>>> On Mon, 29 Nov 2021 15:55:16 +0000, André A. Gomes <andremegafone@gmail.com> said:
André> Robert Pluim <rpluim@gmail.com> writes:
>> What might be more useful is an input-method ring, so
>> you could quickly switch between 2 or more input methods.
André> I agree. It should be easier to go from any 2 input methods defined by
André> quail.
André> I will add it to my todo.
A rough cut. Of course this should probably be part of `toggle-input-method'.
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index b922f192a9..4f385d5b79 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1553,6 +1553,35 @@ set-input-method
(defvar toggle-input-method-active nil
"Non-nil inside `toggle-input-method'.")
+(if dump-mode
+ (load "emacs-lisp/ring")
+ (require 'ring))
+(defvar input-method-ring nil)
+(defun update-input-method-ring (variable value)
+ (when (length> value 0)
+ (dolist (im value)
+ (when (not (assoc (symbol-name im) input-method-alist))
+ (error "%S is not a known input method" im)))
+ (setq input-method-ring (ring-convert-sequence-to-ring value)))
+ (set-default variable value))
+
+(defcustom input-method-list nil
+ "List of input methods to cycle through with `cycle-input-method'."
+ :type '(choice (const nil)
+ (repeat :tag "List of input methods"
+ (symbol :tag "Input method")))
+ :group 'mule
+ :set #'update-input-method-ring
+ :version "29.1")
+
+(defun cycle-input-method ()
+ "Cycle through `input-method-ring'."
+ (interactive)
+ (if (and current-input-method
+ (ring-member input-method-ring (intern current-input-method)))
+ (activate-input-method (ring-next input-method-ring (intern current-input-method) ))
+ (activate-input-method (ring-ref input-method-ring 0))))
+
(defun toggle-input-method (&optional arg interactive)
"Enable or disable multilingual text input method for the current buffer.
Only one input method can be enabled at any time in a given buffer.
Robert
--
next prev parent reply other threads:[~2021-11-29 16:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 3:08 bug#52173: `ś' character not available using `C-x 8' Tor Kringeland
2021-11-29 9:30 ` Robert Pluim
2021-11-29 13:55 ` Tor Kringeland
2021-11-29 14:06 ` Robert Pluim
2021-11-29 14:24 ` Lars Ingebrigtsen
2021-11-29 14:37 ` Robert Pluim
2021-11-29 14:43 ` Lars Ingebrigtsen
2021-11-29 14:49 ` Robert Pluim
2021-11-29 18:11 ` Tor Kringeland
2021-11-29 18:44 ` Lars Ingebrigtsen
2021-12-03 15:55 ` Tor Kringeland
2021-11-29 15:55 ` André A. Gomes
2021-11-29 16:52 ` Robert Pluim [this message]
2021-11-29 17:03 ` André A. Gomes
2021-11-29 17:19 ` Robert Pluim
2021-12-03 16:44 ` Lars Ingebrigtsen
2021-12-04 5:46 ` Richard Stallman
2021-12-04 5:56 ` bug#52173: `Å›' " Lars Ingebrigtsen
2021-12-05 5:07 ` Richard Stallman
2021-12-05 5:10 ` bug#52173: `Å›' " Lars Ingebrigtsen
2021-12-06 4:33 ` Richard Stallman
2021-12-06 5:04 ` bug#52173: `Å›' " Lars Ingebrigtsen
2021-12-06 17:38 ` Juri Linkov
2021-12-07 4:16 ` Richard Stallman
2021-11-29 17:09 ` bug#52173: `ś' " Juri Linkov
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=875ysa6h0h.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=52173@debbugs.gnu.org \
--cc=andremegafone@gmail.com \
--cc=tor.a.s.kringeland@ntnu.no \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).