From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: pre-command-hook with input methods
Date: Fri, 06 Feb 2015 13:55:19 +0000 [thread overview]
Message-ID: <87fvajb0vs.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <jwvh9v02k2i.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 5 Feb 2015 15:19:40 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> All fine, but it's breaking my completion framework which removes
>> previously offered completions on the pre-command-hook.
>
> Indeed, I wouldn't be surprised if several other uses of
> pre-command-hook could suffer from unexpected behaviors in
> such situations.
At a quick test, the auto-complete package also behaves badly wrt input
methods. The on-screen output is bizarre, although what you end up with
in the buffer looks correct, so I guess it is the same problem.
>
>> I need it to run as soon as the "a" key has been pressed.
>
> Of course, you can do that using one of the input-method hooks (maybe
> input-method-after-insert-chunk-hook), or you could rely on
> before-change-functions.
Gave that a quick go. As far as I can see, after-insert-chunk-hook
runs after the input is complete. Likewise, b-c-f which only runs when
the buffer has changed.
>> Is there a better hook?
>
> I don't think so, sadly.
>
> Maybe we could introduce a new hook like `after-idle-hook'. Part of the
> question is what should happen if a timer or a process filter runs
> (these can run while Emacs is "idle")? How 'bout when that
> timer/process-filter inserts text near/at point?
I do buffer analytics in the idle cycle -- I would guess that the same
thing is true for most completion packages. So I'd need to be able to
distinguish between this and the user doing something.
What about after-user-interaction-hook? Or
after-something-has-happened-that-changes-the-display-on-screen-of-a-buffer.
Although the latter might be affected by things that change the mode
line in the idle cycle (like a word count mode).
Phil
next prev parent reply other threads:[~2015-02-06 13:55 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 [this message]
2015-02-06 15:17 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fvajb0vs.fsf@newcastle.ac.uk \
--to=phillip.lord@newcastle.ac.uk \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.