From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: "after" variable watchers Date: Tue, 18 May 2021 19:01:34 +0200 Message-ID: References: <83lf8du09t.fsf@gnu.org> <3431d752-559a-7d33-e2fb-2d81dd6cc794@gmx.at> <5a8b6fc9-cca8-374c-39f8-3f3d0f83fbca@gmx.at> 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="29066"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , npostavs@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 18 19:02:54 2021 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 1lj37O-0007Il-5k for ged-emacs-devel@m.gmane-mx.org; Tue, 18 May 2021 19:02:54 +0200 Original-Received: from localhost ([::1]:33230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj37N-0001R9-4K for ged-emacs-devel@m.gmane-mx.org; Tue, 18 May 2021 13:02:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj36I-0000it-9s for emacs-devel@gnu.org; Tue, 18 May 2021 13:01:46 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:33801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj36G-00035U-7u; Tue, 18 May 2021 13:01:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621357296; bh=W0/WoBPwWczoCXVNwnXRcF0bBjjjdWaFUpLc5ws/1+c=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=WmTSMzbvIuBNJyiXlT9SRN6pbKgn2VpssRSnJlzwlzB54ux8zySbsyqV4uwUrxci4 rvopkfZ3r7PqPtHrZqyRebqLm+VUKSv/mFJMfdl+O/Lo2ft2Q6KVjo2GOuSmWzAF7s x05tD6LmybcHzc1rINvd46yQvjmWtX8W/yagKg6A= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([213.142.96.212]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWASY-1lxmej3qFW-00XdHK; Tue, 18 May 2021 19:01:36 +0200 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:gYeb2xp1d6uSohfXNgeicCLu8/ntP+TmUzH8KElcMmVihoYUHr1 rVaMfF0c/c6w5iew1/+LYYaiylOCzM9lnslOVLZL+FVqwSoMX+Akoc4yun/zacpuSimi/xJ btZCbtDrA3l23I85KMNK+8m3lcH4saeV1jtFayUUuAP6TI6Y27+Da0hAKItJ8F+8xpZ7MTX ppqLj1FjVWXVaRuxl+l3Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:kJdKJ5lAURI=:vVHgcwZy257nU+L6kS/Z06 8lEhOq2M6XfATY6JlwzXr05IFxmkUa0Q8gp+ThiOgWrOkXB5NhoIxTj6YZJVjiuQV7mF2B1xe BmYbVy0BoL6hcGLi8wyKGjT38KjqV6k8y1rpa5D91X9QY73/MYsJsD7gKlB5BonUUcN3w0T87 4H2yeO4mU8PZ0rWevCJQ27DCZ4HV7i4y5rUW4b+20CCHuGAMvAHYXKdYdvcz1ZAQZ2e9bPWP5 F6vSkFhzvIEA5zCP0Kru9CZUvv47kj2VDuoRSf2NQVGIfvYNj26/eBOW/b2PlYEQNzjMZc0us STugBUj86bXee8FXrjfi0O8SsCQNbsEviHAheOw/6AeMlNl49KqJ+tLNKB/BjRo/+UhiBAmL+ 9KVamQg+EfnG/XGNMi3p5nztl8ISP/F8STWorxKzwHmw6V20cjOxLb+FepAXw/TlC7s2eAjMk aMCVWJN12rkizOVOCx8dRVGyDgDO/ahZt0MSh3/47oRp5jOWsjC6b6xCxp5j8ZBSR5l/UMxuK sJrSO6ARMVB4NwkQb2ERdU5wlYQEY+OEIc6uhztywiHqARNlc5YJcd+5znLF20Npa187+ANEo EvnSgFrwmI/9mmq4juWg9Lk1qX5xpxCU6UjtkFeABF1mQGUfoSbOkC7TOSKHmJWkXXp+1U1St ZNnpEdCWwNOSA2Pis3uYRvMcSa+QsATQuYXCWdju3p9v416O8NwuyWq3dTr++AzsNbhxtfyXX tfsaSfLFsxZkFvDiRoFJm51qIHafsRmpeQdsSPCMpjN8LIh8Am2m7YKlEKc40w+mcNzSAOEl Received-SPF: pass client-ip=212.227.17.22; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:269467 Archived-At: > What was the problem you encountered when you tried to add: > > if () window_updeco_window (...); > > to the getters of the realized values? There are too many implicit "realized" values to make this work nicely. Think of macros like WINDOW_BODY_PIXEL_WIDTH, WINDOW_BOX_LEFT_EDGE_X, WINDOW_BOX_RIGHT_EDGE_X, WINDOW_SCROLL_BAR_X or functions like window_box_height in addition to the things window_updeco_window sets directly. > You obviously know more about this code, so I can't say much more. > I was just pointing in the direction of using dirty "bits" (it's > actually often better to represent dirty state via things like our > buffer ticks than via actual `dirty` bits) because it's the standard > solution for such problems: experience has usually shown that decoupling > the setting of vars from the execution of the consequences usually leads > to a much more solid design where it's much easier to deal with problems > of inf-loops or (in)efficiency. Right. But note that I implicitly call window_updeco_window also whenever I change a window's size, for example, from adjust_frame_size after a frame got resized. A `window-body-size' or `window-min-size' call after that would then require to run window_updeco_window too. Identifying all sorts of such getters is not a very reliable process. (BTW, identifying all sorts of setters is not that easy either - face-remap.el alone contains six calls for this.) I do use a quite extended mechanism for identifying a "dirty" state when trying to catch changes in windows (see run_window_change_functions) so I think that I'm not allergic to such a solution. But in the case at hand I simply failed to integrate it well in the existing framework. martin