|
From: | Stefan Monnier |
Subject: | Re: 27.0.50: How can I test a buffer-local window-configuration-change-hook in batch mode? |
Date: | Sun, 27 Oct 2019 13:40:49 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> 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. > The premises were that (1) 'window-configuration-change-hook' is not > called in batch mode and must be therefore emulated (using some sort > of 'get-buffer-window-list' at least) I don't see any need to "emulate" it, usually. Phil was only annoyed that it doesn't trigger in his tests which makes it hard for him to test that the hook does its job. Emulating the hook would largely defeat the purpose of the test: you end up testing your emulation instead. > and (2) a buffer might never get displayed, so the function will > remain on the hook Right. Just like it would remain on your new hook. I don't see this as a problem. Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |