From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Should text-scale trigger hooks? Date: Thu, 07 Nov 2024 10:58:44 +0200 Message-ID: <86a5ebqv23.fsf@gnu.org> References: <9cf01065-4f23-435b-b895-d02beef860a8@jamescherti.com> <86r07nr0qw.fsf@gnu.org> <86ed3ne9oy.fsf@fastmail.fm> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4033"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contact@jamescherti.com, emacs-devel@gnu.org To: Joost Kremers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 07 09:59:52 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t8yMh-0000qe-25 for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Nov 2024 09:59:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8yLq-0002n8-At; Thu, 07 Nov 2024 03:58:50 -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 1t8yLo-0002mz-Hb for emacs-devel@gnu.org; Thu, 07 Nov 2024 03:58:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8yLo-0003BX-3t; Thu, 07 Nov 2024 03:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WYB0ByK3KR2TSoonap4nhLOEBwviDGDSxKTQgvUa3MY=; b=h2KaPZb0w0Bh umETh8OStl3KNdUpHiyGRjx2ZAxPqhtuA7ZCe01j+g5h4zDAjyhcYpBXwdSKnIVsxzwuICtvGVZAy TD9NDQN3RcamicUtPUqji+Iwdt6+VIm+Shl8XbsGD2+0JdE1GZ3StQ7A8etkMa3v2Gr7gW88lPxeT vX05uPGJ4Y4gotObY16Bccf/jrzbj7deItsZfqupRpCv4QewJhgSB40xamASO3XwOAGza4Buup+/+ WGAPftkaVr5tqzhdZFDA/PbR1PXEcdGC4iv5LFu4EAi8HjBz4mU3Je+79ghcetGJnXNYqSSJI2FQB n3JaHkf5KZAeIO+4lVfY+A==; In-Reply-To: <86ed3ne9oy.fsf@fastmail.fm> (message from Joost Kremers on Thu, 07 Nov 2024 09:21:01 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325214 Archived-At: > From: Joost Kremers > Cc: James Cherti , emacs-devel@gnu.org > Date: Thu, 07 Nov 2024 09:21:01 +0100 > > On Thu, Nov 07 2024, Eli Zaretskii wrote: > > The functions which manipulate face-remapping-alist force redisplay of > > the buffer in which the alist was changed, and from Emacs display POV > > this is the only thing that should happen to make sure the affected > > buffer's display is redrawn. Please explain why buffer's redisplay is > > not enough for the packages you mention to do their job. > > Speaking for `visual-fill-column`: it's a package that adjusts the text > margins in wide windows. The goal is to have buffers that use > visual-line-mode wrap text at `fill-column`, not at the window's edge. If > the window configuration or size changes, the width of the margins needs to > be recalculated, so the package puts a function on the relevant hooks to do > that. The need for adjusting the margins in this case is specific to how the visual-fill-column package uses the margins, it is not a general need. In general, whether the margins need to be adjusted according to text scale depends on what are margins used for; they can be used for more than just showing text of the same default face. This is why Emacs doesn't automatically resize the margins in this case. > If the text size is changed, the window margins also need to be > recalculated, but this does not happen automatically. The README of > `visual-fill-column` suggests to advise the function > `text-scale-adjust` to solve this (see > https://codeberg.org/joostkremers/visual-fill-column#adjusting-text-size), > but it's an ad hoc solution, of course. What are the problems of using text-scale-mode-hook? Or even using add-variable-watcher to cause Emacs call your function when face-remapping-alist changes? IOW, why do you think this is a core Emacs issue, not an issue with how visual-fill-column is implemented?