From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Is there something like `on-display-functions'? Date: Thu, 28 Jan 2010 07:54:34 -0500 Message-ID: References: <20100127135716.GA3432@muc.de> <20100127153733.GD3432@muc.de> <83k4v34f49.fsf@gnu.org> <83fx5r48gd.fsf@gnu.org> <20100128103856.GC2285@muc.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1264683579 10229 80.91.229.12 (28 Jan 2010 12:59:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2010 12:59:39 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 28 13:59:35 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 1NaTy6-0006h0-NB for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2010 13:59:31 +0100 Original-Received: from localhost ([127.0.0.1]:52760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaTy6-0005O9-97 for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2010 07:59:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaTtX-0001g2-GA for emacs-devel@gnu.org; Thu, 28 Jan 2010 07:54:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaTtS-0001de-F8 for emacs-devel@gnu.org; Thu, 28 Jan 2010 07:54:46 -0500 Original-Received: from [199.232.76.173] (port=46722 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaTtR-0001dV-RW for emacs-devel@gnu.org; Thu, 28 Jan 2010 07:54:42 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:60605) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaTtQ-0001IY-Bp for emacs-devel@gnu.org; Thu, 28 Jan 2010 07:54:41 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NaTtK-0007Xj-W6; Thu, 28 Jan 2010 07:54:35 -0500 In-reply-to: <20100128103856.GC2285@muc.de> (message from Alan Mackenzie on Thu, 28 Jan 2010 10:38:56 +0000) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:120568 Archived-At: > Date: Thu, 28 Jan 2010 10:38:56 +0000 > Cc: Stefan Monnier , emacs-devel@gnu.org > From: Alan Mackenzie > > As a zero order approximation, something like > `before-display-functions', where an element would look like this: > > (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? > (Is it possible in general to determine BEG and END before > fontification?). Only approximately. E.g., imagine a `display' property whose value is a long string -- without computing how it will be displayed, there's no way of knowing how much of the screen estate it will take. As another, less exotic example, imagine font-lock definitions that enlarge the font significantly: until you fontify that part, you cannot know how much screen space it will take. BEG and END are well known _after_ redisplay prepares what will be shown on the glass, though. Therefore, please tell why do you ask to call this hook _before_ fontifications.