From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: pre-command-hook with input methods Date: Wed, 11 Feb 2015 17:17:19 +0000 Message-ID: <87k2zopduo.fsf@newcastle.ac.uk> References: <878ugcmqr6.fsf@newcastle.ac.uk> <87fvajb0vs.fsf@newcastle.ac.uk> <87siej9h8c.fsf@newcastle.ac.uk> <87iofb2wfk.fsf@newcastle.ac.uk> <87egpz14re.fsf@newcastle.ac.uk> <878ug53ljk.fsf@newcastle.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423675057 3758 80.91.229.3 (11 Feb 2015 17:17:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2015 17:17:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 11 18:17:36 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YLaut-0001xi-PF for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2015 18:17:35 +0100 Original-Received: from localhost ([::1]:46250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLaut-00074A-3j for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2015 12:17:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLaun-000700-DS for emacs-devel@gnu.org; Wed, 11 Feb 2015 12:17:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLaui-00044A-GV for emacs-devel@gnu.org; Wed, 11 Feb 2015 12:17:29 -0500 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:58583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLaui-00042i-6p for emacs-devel@gnu.org; Wed, 11 Feb 2015 12:17:24 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1YLaud-0003i4-Bh; Wed, 11 Feb 2015 17:17:19 +0000 Original-Received: from jangai.ncl.ac.uk ([10.66.67.223] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YLaud-0006Eg-8d; Wed, 11 Feb 2015 17:17:19 +0000 In-Reply-To: <878ug53ljk.fsf@newcastle.ac.uk> (Phillip Lord's message of "Tue, 10 Feb 2015 14:09:51 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182909 Archived-At: Phillip Lord 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 (mapcar #'window-buffer wins))) >> ))) >> >> 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 . > [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