emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pre-command-hook with input methods


From: Phillip Lord
Subject: pre-command-hook with input methods
Date: Thu, 05 Feb 2015 13:28:45 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)


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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]