all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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: Mon, 09 Feb 2015 15:30:45 +0000	[thread overview]
Message-ID: <87egpz14re.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <jwv7fvrupg0.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 9 Feb 2015 09:41:35 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> The Right Way to fix this is to change the default value to be non-nil.
>>> In this case, I think using #'list might work.
>> I am not sure how that would work.  Surely the point of having this as a
>> variable is that it can be changed?
>
> I'm only suggesting to change the default value from nil to `list',
> which I just did in "master".
>
> This then allows you to use `add-function' on that variable.

Ah, sorry. The advice is actually on the variable, and no on the
symbol stored in the variable? So it runs even if the value changes?



> But I still think there's room for improvement with something like
> a `pre-interaction-hook' or something like that.  Brings me to the next
> question.  We know you'd like such a pre-interaction-hook to be run just
> before processing the first char in a multi-char input-method element,
> but what about the simpler/common case of a key prefix:
>
> When the user hits C-x C-f, would you like to run this
> pre-interaction-hook right when the user hits C-x, or only after the
> user hit C-x C-f?
>
> Maybe what you're after is just an input-event-hook?

So, currently, the offered completion remains in buffer until the key
sequence has been completed. Once you have typed the first part of the
keysequence through (C-u or C-x) then the abbreviation is going to
disappear one way or the other. Either you complete the sequence (which
runs a command) or you quit (which runs a command).

I think for consistency, the hook should run immediately before or after
Emacs responds to C-u (or C-x) depending on whether it is pre- or post-.
Effectively, the C-x of a C-xC-f is, I think equivalent to the first "a"
of a "a`" post-fix input key sequence. The only reason that the former works
fine for me, and the latter is problematic is the latter changes the
display of the buffer while the former changes just the mini-buffer.

So, my initial feeling is that it doesn't make any difference for this
particular use case.

The other possibility is not to have an interaction hook but to have a
"the buffer has just changed in some way that is liable to cause a
redisplay"-hook. I don't know that this would be better. I throw it out
as a possibility, depending on which is easier.

Phil



  reply	other threads:[~2015-02-09 15:30 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
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 [this message]
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=87egpz14re.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.