From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: phillip.lord@newcastle.ac.uk (Phillip Lord)
Cc: emacs-devel@gnu.org
Subject: Re: pre-command-hook with input methods
Date: Fri, 06 Feb 2015 10:17:55 -0500 [thread overview]
Message-ID: <jwvr3u3yt7e.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87fvajb0vs.fsf@newcastle.ac.uk> (Phillip Lord's message of "Fri, 06 Feb 2015 13:55:19 +0000")
> 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
next prev parent reply other threads:[~2015-02-06 15:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 13:28 pre-command-hook with input methods Phillip Lord
2015-02-05 20:19 ` Stefan Monnier
2015-02-06 13:55 ` Phillip Lord
2015-02-06 15:17 ` Stefan Monnier [this message]
2015-02-06 15:45 ` Phillip Lord
2015-02-06 23:58 ` Stefan Monnier
2015-02-09 10:47 ` Phillip Lord
2015-02-09 14:41 ` Stefan Monnier
2015-02-09 15:30 ` Phillip Lord
2015-02-09 16:13 ` Stefan Monnier
2015-02-10 14:09 ` Phillip Lord
2015-02-11 17:17 ` Phillip Lord
2015-02-11 19:21 ` Stefan Monnier
2015-02-12 10:27 ` Phillip Lord
2015-05-25 22:52 ` Stefan Monnier
2015-05-27 16:03 ` Phillip Lord
2015-05-27 19:45 ` Stefan Monnier
2015-05-27 21:54 ` Phillip Lord
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=jwvr3u3yt7e.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=phillip.lord@newcastle.ac.uk \
/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).