From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: James Cherti <contact@jamescherti.com>
Newsgroups: gmane.emacs.help
Subject: Re: Run `window-configuration-change-hook` in Lisp code?
Date: Thu, 7 Nov 2024 00:35:05 -0500
Message-ID: <5193f2dd-05ca-4a92-a3f9-2a069b8ad72e@jamescherti.com>
References: <86ttckxian.fsf@fastmail.fm>
 <jwvbjyr3b3h.fsf-monnier+emacs@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="6849"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla Thunderbird
To: help-gnu-emacs@gnu.org
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 07 15:14:03 2024
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1t93Gs-0001dX-3M
	for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 07 Nov 2024 15:14:02 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <help-gnu-emacs-bounces@gnu.org>)
	id 1t93GJ-0000QP-NC; Thu, 07 Nov 2024 09:13:28 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <contact@jamescherti.com>)
 id 1t8vAl-0005Sc-L0
 for help-gnu-emacs@gnu.org; Thu, 07 Nov 2024 00:35:11 -0500
Original-Received: from fly.ash.relay.mailchannels.net ([23.83.222.61])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <contact@jamescherti.com>)
 id 1t8vAj-00063P-NJ
 for help-gnu-emacs@gnu.org; Thu, 07 Nov 2024 00:35:11 -0500
X-Sender-Id: dreamhost|x-authsender|contact@jamescherti.com
Original-Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 3EED01C2195
 for <help-gnu-emacs@gnu.org>; Thu,  7 Nov 2024 05:35:07 +0000 (UTC)
Original-Received: from pdx1-sub0-mail-a288.dreamhost.com
 (100-103-175-120.trex-nlb.outbound.svc.cluster.local [100.103.175.120])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id BB49A1C155D
 for <help-gnu-emacs@gnu.org>; Thu,  7 Nov 2024 05:35:06 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1730957706; a=rsa-sha256;
 cv=none;
 b=m0ok1gxHH1upHUpJb5g+0sVqorZO8h7nNTvO77QxEcM9NivwuHksd/+HZpBBr47btOdCBP
 YsWQeIES0w8zoTRjlJplzQZBlcmb4rgqd65akkgjazBd7dMY3VCTj9E9HIXBLKhPF+rJR4
 kPPOWsst6dtMOhnF/KL7+fJL9gaYGpXvDfN+xyakyN78d4wEtF1rKII6q8C1ix/hw+PmeI
 VKnc08NB4f13o2XOlzVrDTcvqFbLeMxo5pmeKPubnqODqdatXOaNm0Pckqs/IXFL+2Baxc
 3slD89aV4DY02pd5+DyuFn8y4NKw3E/cfXu00eBLmYO0BWi5S5U0aKlEDqwG8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1730957706;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=nvsDqb4xu2UVjmsR7ksaT50oVgeF2Qb8VkscOJp+DyA=;
 b=oFabrOCfd7DStzxi3O9vvDohAV61KvkJKfpCrVAKdJc9FsEvq6+1iwFsEjjETtH9Ohxypf
 QIRoye0jVpU1tPcJooUfdyRASqzIRVpfUsPCQHypyARZY5uAXCcG+TtnrvfsuQfKEnQ0Ey
 hZWeKdnmqO2blHncMsLa1y35tCb5vZ4Nu3H0SiSL+Q5X10czh3J1PaYL/HToRcGwAiRVEv
 g0Czjb6v3lTOzzZgCFOPI46v1+c2LyarkMzBX+RnqCB7dR9DB8H2wDOCkmJUOO3iMzWXV0
 qlWMcjK0XBMTudsR07fQ4wyzFHGMcz5j03JXBx/I9yIbzCbfO6WOqUhG4UBaTg==
ARC-Authentication-Results: i=1; rspamd-5fd7cbc7bc-f7mk9;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=contact@jamescherti.com
X-Sender-Id: dreamhost|x-authsender|contact@jamescherti.com
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|contact@jamescherti.com
X-MailChannels-Auth-Id: dreamhost
X-Tart-Quick: 7e408a500ae292b7_1730957706980_3646621886
X-MC-Loop-Signature: 1730957706980:2084757746
X-MC-Ingress-Time: 1730957706980
Original-Received: from pdx1-sub0-mail-a288.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.103.175.120 (trex/7.0.2); Thu, 07 Nov 2024 05:35:06 +0000
Original-Received: from [192.168.5.23]
 (bras-base-toroon0648w-grc-11-142-198-74-25.dsl.bell.ca [142.198.74.25])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: contact@jamescherti.com)
 by pdx1-sub0-mail-a288.dreamhost.com (Postfix) with ESMTPSA id 4XkW4B3n0pz1P
 for <help-gnu-emacs@gnu.org>; Wed,  6 Nov 2024 21:35:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jamescherti.com;
 s=dreamhost; t=1730957706;
 bh=nvsDqb4xu2UVjmsR7ksaT50oVgeF2Qb8VkscOJp+DyA=;
 h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
 b=FHMKlmah+lc8Mp54cr0ovTTHOLPqRTeZF8MQWN2aBTMC26PBS9pDiE8bZMwlTY3hM
 U1fJsDi2hIg3QjDqRSWcYMgN+cf77LRxL4zl0MQ1oi5AuCT9yxPTOt2tvpRQcuNDkJ
 RNJvj3f1MubMKOFOHcPDWICqj+toSOWatXfpU0iVfhvSuRr5R4yzFiMTINr/JSegRQ
 Ko829nZ85vEmiA9TgFoAYRPbziS7tPLdzDvvA2HRCANvZOWfLJtyPaMDP1Ze6WUnCo
 S1cKBWdZbIc1Jz0xFBkfFO3m6VkSzh1r7qDpzwznamCXFXwJqdqx3W9Idb7XIfyXgC
 b3Ay1AgVmh+lA==
Content-Language: en-US
In-Reply-To: <jwvbjyr3b3h.fsf-monnier+emacs@gnu.org>
Received-SPF: pass client-ip=23.83.222.61;
 envelope-from=contact@jamescherti.com; helo=fly.ash.relay.mailchannels.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Mailman-Approved-At: Thu, 07 Nov 2024 09:13:23 -0500
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
 <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
 <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.help:148283
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/148283>

Hello Stefan,

Here is a summary of an email I sent to emacs-devel (Subject: Should 
text-scale trigger hooks?): I have identified an issue that affects 
Emacs packages such as eat (terminal) and visual-fill-column. Functions 
like `text-scale-increase`, `text-scale-decrease`, and `text-scale-set` 
do not trigger hooks like `window-configuration-change-hook`. As a 
result, the eat package does not immediately update the window when the 
text scale is changed, and visual-fill-column does not update the margin 
right away (it updates only after the window is resized).

The workaround to fix this issue is to call the following after the text 
scale is changed:
(run-hooks 'window-configuration-change-hook)

OP wants to know whether it is good practice or bad practice to run the 
`window-configuration-change-hook` hooks from a third-party package in 
this situation, as a workaround to resolve the issue described above. 
(Check: https://codeberg.org/joostkremers/visual-fill-column/pulls/16 ).

--
James Cherti
https://www.jamescherti.com/

On 2024-11-06 23:47, Stefan Monnier via Users list for the GNU Emacs 
text editor wrote:
>> Something that just came up: is it OK to run
>> `window-configuration-change-hook` in Lisp code? The doc string says
>> "Functions called during redisplay when window configuration has changed",
>> which gives me the impression that it's *only* meant to be run during
>> redisplay, i.e., not during Lisp code.
> 
> That description describes when the C code runs this hook.
> Do you want to run this hook yourself manually at other times?
> If so, why?
> 
> 
>          Stefan
> 
>