[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Timing of input-method output
From: |
Stefan Monnier |
Subject: |
Re: Timing of input-method output |
Date: |
Tue, 26 Mar 2019 11:12:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> I've done a bit more work on this and come up with a much simpler
> solution which is specificially plumbed into quail. It looks like this:
>
> modified lisp/international/quail.el
> @@ -59,6 +59,10 @@ quail
> "Quail: multilingual input method."
> :group 'leim)
>
> +
> +(defvar quail-pre-translation-hook nil
> + "Normal hook run before quail starts or updates a translation.")
> +
> ;; Buffer local variables
>
> (defvar quail-current-package nil
> @@ -1548,6 +1552,7 @@ quail-update-translation
> `quail-current-key'. If CONTROL-FLAG is nil, proceed the translation
> with more keys."
> (let ((func (quail-update-translation-function)))
> + (run-hooks 'quail-pre-translation-hook)
> (if func
> (setq control-flag (funcall func control-flag))
> (cond ((numberp control-flag)
This looks pretty good, but I'd like to better understand why this
works well. I.e. how did you end up putting it there rather than elsewhere?
> pre-command-hook is current run by "safe_run_hooks". Does
> `quail-pre-translation-hook' need to be as well (in which case, it would
> need uncovering in lisp)? I guess the counter here is that it's possible
> to get out so long as you don't type certain characters, or you change
> buffer. But, it leaves emacs fairly unusuable none the less.
IIUC C-\ should get you out, so I don't think it's necessary to take any
extra caution here.
> And, where do you think I should document it? Perhaps "Invoking the
> Input Method";
That's probably the best place.
Stefan