[Top][All Lists]

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list

From: martin rudalics
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103444: * lisp/facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
Date: Wed, 02 Mar 2011 20:56:58 +0100
User-agent: Thunderbird (Windows/20090302)

>>  > Would it help to have a primitive that returns the width in pixels
>>  > that a given buffer substring would take on the screen?
>> Not really.
> Why not?  Especially since you go one explaining why it _would_ be
> helpful ;-)

I meant it would not help in the case at hand.  It would be helpful in
many other cases ;-)

>> But in general, a primitive that returned the displayed pixel
>> height/width of a substring of any buffer line for some given window
>> would be great.
> What's a window got to do with this?  How can a window affect display
> of a buffer substring?

What I meant was the size in pixel of the displayed text.  If we have an
overlay with a window property plus other text properties - suppose
someone wants to look at the plain buffer text in one window and the
same text outlined or magnified in another window - then we might get
different displayed sizes for the same "buffer substring".

>> Actually, it would be nice if redisplay could cache these values on
>> demand for each line it (virtually) displayed.
> What for?

Because redisplay is costly and running such a function can amount to
doing a redisplay.  If I had such a function, I could synchronize the
text of two side-by-side windows in the presence of characters of
different heights.  This would be useful for side-by-side displayed
diff-windows or for showing line numbers in a side window.  In such
cases a cache would avoid to run what is essentially the same function
twice over the entire text displayed in a window.


reply via email to

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