[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pre-command-hook with input methods
From: |
Stefan Monnier |
Subject: |
Re: pre-command-hook with input methods |
Date: |
Fri, 06 Feb 2015 10:17:55 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> Gave that a quick go. As far as I can see, after-insert-chunk-hook
> runs after the input is complete.
Hmm...
> Likewise, b-c-f which only runs when the buffer has changed.
No, it should run *before* the buffer is changed, and AFAIK the buffer
*is* changed (by inserting an "a") when you hit the "a". this "a" will
get removed later (after you hit the "b") before running the
self-insert-command which will (re)do the insertion.
Oh, wait, I see that quail-input-method starts by let-binding
inhibit-modification-hooks, so indeed, before-change-functions won't be run.
Hmm... of course, you can still try
(add-function :before input-method-function ...)
but since its default value is nil (i.e. incompatible with
add-function), it'll be a bit more tricky (you'll need an :around
advice, and you'll need to check the orig function (in case it's nil)
before calling it).
There's clearly room for improvement here.
Stefan
- pre-command-hook with input methods, Phillip Lord, 2015/02/05
- Re: pre-command-hook with input methods, Stefan Monnier, 2015/02/05
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/06
- Re: pre-command-hook with input methods,
Stefan Monnier <=
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/06
- Re: pre-command-hook with input methods, Stefan Monnier, 2015/02/06
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/09
- Re: pre-command-hook with input methods, Stefan Monnier, 2015/02/09
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/09
- Re: pre-command-hook with input methods, Stefan Monnier, 2015/02/09
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/10
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/11
- Re: pre-command-hook with input methods, Stefan Monnier, 2015/02/11
- Re: pre-command-hook with input methods, Phillip Lord, 2015/02/12