all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* pre-command-hook with input methods
@ 2015-02-05 13:28 Phillip Lord
  2015-02-05 20:19 ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Phillip Lord @ 2015-02-05 13:28 UTC (permalink / raw
  To: emacs-devel



I'm trying to understand the behaviour of pre-command-hook with an input
method set. Using the code below to probe this, I find that with
italian-postfix the pre-command-hook does not get run when I expect.

For instance consider this scenario

Key   Cumulative OnScreen   p-c-h-fired?

g     g                     Yes
a     ga[_`]                No
b     gab                   Yes, twice


So, the pre-command-hook runs only *after* the multi-key press behaviour
has been completed (either by introducing a diacritical letter or by not
doing so). Hence on pressing "b" it gets run twice -- once to say "a has
been entered" and once to say "b has been entered".

All fine, but it's breaking my completion framework which removes
previously offered completions on the pre-command-hook. I need it to run
as soon as the "a" key has been pressed.

Is there a better hook?


(add-hook 'pre-command-hook
          'temp-pre-command-hook)

(defvar-local temp-enable nil)
(defvar temp-count 1)

(defun temp-pre-command-hook ()
  (when temp-enable
    (message "pch:%s"
             (incf temp-count))))



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-05-27 21:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.