|
From: | Stefan Monnier |
Subject: | Re: 27.0.50: How can I test a buffer-local window-configuration-change-hook in batch mode? |
Date: | Sat, 26 Oct 2019 08:05:47 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> The example is actually pretty close to the real use-case. If so-long >> sees a file with very long lines being visited, it (now) only triggers >> its mitigations if and when that buffer is first displayed. So if the >> buffer is never displayed then nothing is done. > Eli, do you think that Phil's use case would warrant a special hook > say 'buffer-first-display-functions' triggered when a buffer's > display-count changes from 0? It would be stunningly simple to > implement that. OTOH, scanning all window changes to find out whether > a buffer has been displayed for the first time just produces lots of > wasted cyles. I don't see much waste: put a function on the window-configuration-change-hook and the first time it's called you know the buffer is displayed so you remove the function from the hook. There's no "scanning all window changes" involved. Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |