emacs-devel
[Top][All Lists]
Advanced

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

Re: How to record the line number pixel width for each window.


From: Keith David Bershatsky
Subject: Re: How to record the line number pixel width for each window.
Date: Fri, 6 Dec 2019 11:29:04 -0800

By "simulate", I had in mind actively using the move_it family of functions -- 
where Emacs inhibits updating the glass and we can navigate the text to 
ascertain and/ or set certain values.  For example, the sample snippet/diff in 
the opening post of this thread occurs when Emacs is using IT to set the value 
of the line number pixel width, and this is happening in the context of what I 
think of as a redisplay simulation.  The solution to my issue may be as simple 
as devising a condition limiting just when to set the window object with the 
line number pixel width; e.g., when IT is on the first visible line of text in 
the window (following the header line, if any).  Right now, the snippet sets 
the value when IT is on other lines besides the first line of text in the 
window, perhaps even a hidden / invisible line due to folded text.  Perhaps 
that folded / invisible line would have a different line number pixel width, 
but it is not used because it is hidden and the value is erroneous.



On Dec 6, 2019, at 10:42 AM, Eli Zaretskii <address@hidden> wrote:

>> Cc: "address@hidden" <address@hidden>
>> From: Keith David Bershatsky <address@hidden>
>> Date: Fri, 6 Dec 2019 09:07:10 -0800
>> 
>> Thank you, Eli, for reading and responding to this thread.  Once the 
>> redisplay cycle gets to the place where update_window is called, all 
>> simulations performed by moving IT have already concluded, and update_window 
>> is the launch-point for features 17684/22873.  I would be comfortable using 
>> an existing instance of screen simulation and perform the essence of 
>> line_number_display_width without launching a new session with 
>> start_display.  The goal is to be as efficient as possible when storing the 
>> values so that they are reliably accessible when update_window gets called.  
>> My general feeling is that update_window is not the place to do screen 
>> simulations (moving IT) and running a _new_ instance of start_display for 
>> each window is not efficient.
>> 
>> Is there an existing instance of a running simulation for each window 
>> somewhere in xdisp.c where I could add the guts of line_number_display_width 
>> without launching a new start_display; and, if so, some pointers on where 
>> that might be located would be greatly appreciated?
> 
> I'm sorry, I don't understand the question.  What do you call
> "simulation" in this context?



reply via email to

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