unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: martin rudalics <rudalics@gmx.at>
Cc: Phil Sainty <psainty@orcon.net.nz>, Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org
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	[thread overview]
Message-ID: <jwvy2x66qei.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <82af48d7-d737-8332-9ed9-7df4bc6c0ebb@gmx.at> (martin rudalics's message of "Sun, 27 Oct 2019 08:49:06 +0100")

>> 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




  reply	other threads:[~2019-10-27 17:40 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 10:50 27.0.50: How can I test a buffer-local window-configuration-change-hook in batch mode? Phil Sainty
2019-10-24 14:23 ` Eli Zaretskii
2019-10-24 23:53   ` Phil Sainty
2019-10-25  8:37     ` Eli Zaretskii
2019-10-25  9:20       ` martin rudalics
2019-10-25  9:34         ` Eli Zaretskii
2019-10-26  7:49           ` martin rudalics
2019-10-26  9:08             ` Eli Zaretskii
2019-10-25 10:31       ` Phil Sainty
2019-10-25 12:42         ` Eli Zaretskii
2019-10-25 12:53           ` Stefan Monnier
2019-10-25 13:57             ` Eli Zaretskii
2019-10-25 15:27               ` Stefan Monnier
2019-10-25 18:41                 ` Eli Zaretskii
2019-10-26 12:33               ` Lars Ingebrigtsen
2019-10-26 12:53                 ` Eli Zaretskii
2019-10-26 13:13                   ` Lars Ingebrigtsen
2019-10-26 13:33                     ` Eli Zaretskii
2019-10-26 13:50                       ` Lars Ingebrigtsen
2019-10-26 14:34                         ` Eli Zaretskii
2019-10-26 14:45                           ` Lars Ingebrigtsen
2019-10-26 15:07                             ` Eli Zaretskii
2019-10-25 13:16           ` Phil Sainty
2019-10-25 13:44             ` Eli Zaretskii
2019-10-25  8:51     ` martin rudalics
2019-10-25 10:54       ` Phil Sainty
2019-10-26  7:49         ` martin rudalics
2019-10-26  9:07           ` Eli Zaretskii
2019-10-26 10:57             ` Phil Sainty
2019-10-26 11:28               ` Eli Zaretskii
2019-10-26 12:11                 ` Stefan Monnier
2019-10-26 12:32                   ` Eli Zaretskii
2019-10-26 15:59                     ` Stefan Monnier
2019-10-26 16:28                       ` Eli Zaretskii
2019-10-26 17:14                         ` Stefan Monnier
2019-10-26 17:35                           ` Eli Zaretskii
2019-10-26 19:53                             ` Stefan Monnier
2019-10-26 20:18                               ` Eli Zaretskii
2019-10-26 13:09                 ` Phil Sainty
2019-10-26 13:31                   ` Eli Zaretskii
2019-10-26 12:05           ` Stefan Monnier
2019-10-27  7:49             ` martin rudalics
2019-10-27 17:40               ` Stefan Monnier [this message]
2019-10-28  9:39                 ` martin rudalics
2019-11-10  3:50                   ` so-long.el updates (was Re: 27.0.50: How can I test a buffer-local window-configuration-change-hook in batch mode?) Phil Sainty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy2x66qei.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=psainty@orcon.net.nz \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).