unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: emacs-devel@gnu.org
Subject: pre-command-hook with input methods
Date: Thu, 05 Feb 2015 13:28:45 +0000	[thread overview]
Message-ID: <878ugcmqr6.fsf@newcastle.ac.uk> (raw)



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	other threads:[~2015-02-05 13:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 13:28 Phillip Lord [this message]
2015-02-05 20:19 ` pre-command-hook with input methods 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

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=878ugcmqr6.fsf@newcastle.ac.uk \
    --to=phillip.lord@newcastle.ac.uk \
    --cc=emacs-devel@gnu.org \
    /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).