From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Cherti Newsgroups: gmane.emacs.help Subject: Re: Run `window-configuration-change-hook` in Lisp code? Date: Fri, 8 Nov 2024 10:51:20 -0500 Message-ID: References: <86ttckxian.fsf@fastmail.fm> <5193f2dd-05ca-4a92-a3f9-2a069b8ad72e@jamescherti.com> 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="35174"; 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 Fri Nov 08 16:52:19 2024 Return-path: 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 ) id 1t9RHX-0008xC-AU for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 08 Nov 2024 16:52:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9RH1-0003g8-JZ; Fri, 08 Nov 2024 10:51:47 -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 ) id 1t9RGj-00039t-Dq for help-gnu-emacs@gnu.org; Fri, 08 Nov 2024 10:51:30 -0500 Original-Received: from dormouse.elm.relay.mailchannels.net ([23.83.212.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9RGg-0007Dh-RX for help-gnu-emacs@gnu.org; Fri, 08 Nov 2024 10:51:29 -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 6A6A18A3940 for ; Fri, 8 Nov 2024 15:51:23 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a293.dreamhost.com (100-111-109-20.trex-nlb.outbound.svc.cluster.local [100.111.109.20]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 1C86E8A5CEB for ; Fri, 8 Nov 2024 15:51:23 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1731081083; a=rsa-sha256; cv=none; b=9NSjAYBwAXAWWgMpzTqh0wEh3jifbNnqzOCSg7lYNc1fNiPlZedkkPr7Ekp/FQkyfuy0kL nMcIf8YigsoqEx8Yl2v9xqSIMJE4hX3e4QkdhpUPOeRZ7odApq/AWIOEp4HR4dKTt6v8op UV9/k8Nm9mMZH3MCgQdbfd0L20Lx5kFMheuiJ+nFyd0bAnr/UNT6IknruiOTNb56fmI76m NkuYHZ5VQMwT0E4MvPIN0+aYa1t9XcubVgEqgx3AIydojJOTc4tdYhDmP1WUZz0VUKQjyY 99CLDEYspnXPessR8Bt5CRtaYQSkK5FoG+lO2jYTAIS5mFIC5Ahe4mC+X61HVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1731081083; 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=z5zZ3m+cM0EeaGh2aFsv1YZE69qtk8ZftBtXAU7YCI4=; b=6w6PrjibdwXNeVfM3C+8DKwEQdB1YACceSCo1FPt9bTwsamuLKVxRdGlfvQjtIkAkNeUZ7 /hLL8D9QAFgBY5CF9ei8931lqO11uoCnj09EIq9I1NhMripB6IJIIQJGF5FBEm17b4GuUt 2LOUzEU+2Drx5mOvYYUp9LjWo/q3APBAScSRrxtCixFcw0RRO7YBcH42km6BsKBuHdfS0b Mawrbo8OYO0Kf7jjznaEGsFMhhpleo6KazIDl7jWJqLxhY27vtG9OFL9D6RlOXG65o16cD 0tv69bms1LVHr7XAfxi6zjR+SoiFijqo0fpw2znxB/yBtp61Mzd5gbNdZ7VkZA== ARC-Authentication-Results: i=1; rspamd-859c487578-8hww2; 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-Shade-Harmony: 2fb4db925495e9b7_1731081083326_2250458654 X-MC-Loop-Signature: 1731081083326:3409111895 X-MC-Ingress-Time: 1731081083326 Original-Received: from pdx1-sub0-mail-a293.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.111.109.20 (trex/7.0.2); Fri, 08 Nov 2024 15:51:23 +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-a293.dreamhost.com (Postfix) with ESMTPSA id 4XlNhp64Jfz6c for ; Fri, 8 Nov 2024 07:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jamescherti.com; s=dreamhost; t=1731081083; bh=z5zZ3m+cM0EeaGh2aFsv1YZE69qtk8ZftBtXAU7YCI4=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=Ful5n0Dy9KfW1r9mh/UOEQriwNb4d/TP+WEgDOAG42OAnX8465Meoc3tbhplMxJxz FWtv5QoefNIgHS5f9gGAeDTzAbeOLdIpHtPWBx4axICp6l+v0CIW3KeCklowuECJSc lWQIXJBRQCseYSIgW7/T3FkOYway8p5MmfBPdgkRSouIfiKOnUneWyAY5iIXrqSrFP Sz1KONQckxDvaJu1BF28Wa28ifJd3gKquiIC5+UhWt3tgSnWAEy3Wq7TOJ/gwiKA3n Cg9C0mIcTYm+vzk1pEPvGvpulvESAKl4pOfZee0AKP6dLWivJVSUfUPtVuZRE0WY6k F4/kgtbzsDDXQ== Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=23.83.212.50; envelope-from=contact@jamescherti.com; helo=dormouse.elm.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_H2=-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-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:148287 Archived-At: Thank you for confirming that you would place it in the 'bad practices' column. Yes, the patch works; however, I closed the pull request as it was too specific to another package I'm using, which restores persisted text scale through a hook in `window-configuration-change-hook`. In the general case, however, the need to run window-configuration-change-hook during text-scale-mode-hook is not particularly important. -- James Cherti https://www.jamescherti.com/ On 2024-11-08 09:12, Stefan Monnier via Users list for the GNU Emacs text editor wrote: >> The workaround to fix this issue is to call the following after the text >> scale is changed (run-hooks 'window-configuration-change-hook) > >>>From where? > > The way I see it, another workaround is for those packages which depend > strongly on such single-size monospace text to add the relevant function > to `text-scale-mode-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 ). > > I'd put it in the bad practice column (especially since that hook > is documented to be run in a fairly special way which `run-hooks` > doesn't follow). > > Then again, looking at that patch I can't understand why it would work. > Does it work? If so how? That code is run only when `visual-fill-mode` > is enabled, AFAICT, so whether it runs > `window-configuration-change-hook` won't make any difference when > text-scale is used. > > > Stefan > >