emacs-devel
[Top][All Lists]
Advanced

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

Re: pre-command-hook with input methods


From: Phillip Lord
Subject: Re: pre-command-hook with input methods
Date: Wed, 11 Feb 2015 17:17:19 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Phillip Lord <address@hidden> writes:
>>> 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.
>>
>> Then maybe the (new in 24.4) pre-redisplay-function could be used
>> for that.  Something like
>>
>>     (add-function :before pre-redisplay-function
>>                   (lambda (wins)
>>                     (if (or (eq t wins)
>>                             (memq <mybuffer> (mapcar #'window-buffer wins)))
>>                         <take-foo-down>)))
>>
>> Of course, this will require some care, since a redisplay happens
>> probably right after you've set things up (i.e. before you start
>> waiting for user input), and you don't want *that* redisplay to trigger
>> the <take-foo-down>.
> [snip]
>
> Still, it's there now, so I will give it a go. But having the
> input-event-hook might be better.


Given this a quick go. I was a bit confused because it's
"pre-redisplay-function" and not "pre-redisplay-functions", so I spent a
while using add-hook (didn't have your email to hand at the time).

Once I fixed that, I found that pre-redisplay-function gets called an
awful lot. It's very hard for me to work out why, because all my
debugging techniques for emacs involve some output to screen (i.e.
redisplay!).

For completion purposes though, it does look like pre-redisplay-function
is going to trigger far too often.

I'll try advising the input-method next!

Phil



reply via email to

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