From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Is there something like `on-display-functions'? Date: Fri, 29 Jan 2010 13:09:05 +0000 Message-ID: <20100129130905.GB3272@muc.de> References: <20100127153733.GD3432@muc.de> <83k4v34f49.fsf@gnu.org> <83fx5r48gd.fsf@gnu.org> <20100128103856.GC2285@muc.de> <20100128144707.GF2285@muc.de> <83fx5qt4wi.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1264770155 11864 80.91.229.12 (29 Jan 2010 13:02:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jan 2010 13:02:35 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 29 14:02:32 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NaqUY-0008GW-UX for ged-emacs-devel@m.gmane.org; Fri, 29 Jan 2010 14:02:31 +0100 Original-Received: from localhost ([127.0.0.1]:34940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaqUY-0001ov-Gg for ged-emacs-devel@m.gmane.org; Fri, 29 Jan 2010 08:02:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaqUS-0001og-Rz for emacs-devel@gnu.org; Fri, 29 Jan 2010 08:02:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaqUO-0001no-1L for emacs-devel@gnu.org; Fri, 29 Jan 2010 08:02:24 -0500 Original-Received: from [199.232.76.173] (port=37396 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaqUN-0001nl-Tn for emacs-devel@gnu.org; Fri, 29 Jan 2010 08:02:19 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:1168 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaqUN-000089-7Y for emacs-devel@gnu.org; Fri, 29 Jan 2010 08:02:19 -0500 Original-Received: (qmail 343 invoked by uid 3782); 29 Jan 2010 13:02:16 -0000 Original-Received: from acm.muc.de (pD9E226D3.dip.t-dialin.net [217.226.38.211]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 29 Jan 2010 14:02:15 +0100 Original-Received: (qmail 5190 invoked by uid 1000); 29 Jan 2010 13:09:05 -0000 Content-Disposition: inline In-Reply-To: <83fx5qt4wi.fsf@gnu.org> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120648 Archived-At: Hi, Eli, On Thu, Jan 28, 2010 at 09:18:05PM +0200, Eli Zaretskii wrote: > > Date: Thu, 28 Jan 2010 14:47:07 +0000 > > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > > From: Alan Mackenzie > > > > (defun foo-before-display (buffer beg end) .....) > > > > , BEG and END defining the piece of BUFFER about to be displayed. > > > > The hook would be called before fontification. > > > What do you mean by ``before fontification'', and why does it have to > > > be before that? > > I don't really know what I mean by "before fontification". I want it > > so that if in `foo-before-display' I put syntax-table TP on < and >, > > and point happens to be at one of them, show-paren-mode will work to > > highlight them. > Why do you need to do that only when the text is about to be displayed? > Is it too expensive to do that in the whole buffer or something? People have complained before about "sluggish start up time" when I've added things that scan the whole buffer. Adding 0.5s to startup time could be serious if you've got 50 big C++ buffers in your .emacs.desktop. Maybe. I'm more exploring the possibilities; I might well end up just scanning the whole buffer - PCs aren't getting any slower as time goes by. Currently, the TPs are being added in CC Mode's font locking stuff, which is kind of irritating (to me at least). > Anyway, show-paren-mode works off an idle timer, so I think it is > not necessary to run the kind of function you have in mind before > redisplay; near its end is okay. Thanks. I didn't know that. Maybe `after-redisplay-functions' is really what I'm looking for. > > Maybe an alternative to a hook here would be to allow an application > > to specify that some text property (say, 'c-templatified) is to be > > "special", and when the displayer detects the TP has changed, it > > calls an associated function. 'c-templatified would be analogous to > > 'fontified. > Don't we already have text properties that cause Lisp forms to be > evaluated? Er, yes. help-echo, display (as David pointed out). So it seems I've got what I need, if I need it. > And again, why can't you put your text property everywhere in the > buffer where you want this effect? I can. Maybe I will. -- Alan Mackenzie (Nuremberg, Germany).