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.bugs Subject: bug#70186: Variable watcher notification bugs for "local if set" variables. Fix and ert in email to follow. (5 of 9) Date: Sat, 06 Apr 2024 10:37:31 +0300 Message-ID: <86msq73ps4.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4407"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70186@debbugs.gnu.org To: Robert Burks , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 06 09:38:08 2024 Return-path: Envelope-to: geb-bug-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 1rt0cp-0000uL-CN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Apr 2024 09:38:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rt0ch-0005tm-CQ; Sat, 06 Apr 2024 03:37:59 -0400 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 1rt0cg-0005td-Fg for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 03:37:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rt0cg-00023J-7e for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 03:37:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rt0cm-00060I-69 for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 03:38:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Apr 2024 07:38:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70186 X-GNU-PR-Package: emacs Original-Received: via spool by 70186-submit@debbugs.gnu.org id=B70186.171238906922967 (code B ref 70186); Sat, 06 Apr 2024 07:38:04 +0000 Original-Received: (at 70186) by debbugs.gnu.org; 6 Apr 2024 07:37:49 +0000 Original-Received: from localhost ([127.0.0.1]:38093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt0cV-0005y0-KH for submit@debbugs.gnu.org; Sat, 06 Apr 2024 03:37:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt0cT-0005xa-2k for 70186@debbugs.gnu.org; Sat, 06 Apr 2024 03:37:45 -0400 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 1rt0cH-0001zW-NQ; Sat, 06 Apr 2024 03:37:33 -0400 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=TxUH76+y8Yk/BT30aSWZnmyDG2Atkjv4xoytSsMYjho=; b=pahmUOQv2RxR +rCglGiYBWra8Z5nLPABCWqygAkaB1CTFvp/0UoXQlCHNXQTYtnDmI4fZfd0xzNOcYAJvFBrunO9K UiWw1zpw8LWDjescUv2j0xvKORn9d+P76jR9Dr+eARGf5yEr+P0+UvhG8f9ZcKHoDOltkt0SxJegv egmfpBaOQjKKqmAZ8dI2YksCsyKYCl/w3v/3qdx9FScaczuKex/k9pnWWvHqJ88PZikIuRRmGvGJ8 lq/eiO3iBZryCQDYjjX16HY4sX+UK7Ip5KgP5pgWzJHZsYGOvCYdjmqVv8giQkuoVLxjvlhu7KplS KYsOskLRC2DyJVbdh4wiww==; In-Reply-To: (message from Robert Burks on Thu, 4 Apr 2024 04:46:07 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282751 Archived-At: > From: Robert Burks > Date: Thu, 4 Apr 2024 04:46:07 -0400 > > (5 of 9) > > Bug#00004 (no corresponding unlet notification and improper use of 'where' > for local_if_set buffer local variables that shadow default.) > > ** Bug recreations are at the end > > I have included a patch for this bug that applies on top of my four previous > submissions in the following email. This bug occurs because an unaccounted for > path in do_one_unbind calls set_default_internal. Current regression testing > only tests reaching the section of code my patch resides in from a direct call > using set-default. I have also included testing that covers all the examples > provided in the next email. > > It was the end of this bug's testing in which I unraveled even more existing bugs > in which my work did not already solve. The bug following this required being > solved in conjunction with this bug. > > Bug Recreation------------------------------------------------------------------ > > ------------------------------------------- > - LIS let and set in the same buffer. (shadows default) > ------------------------------------------- > (defvar-local test 100) > test > > (defvar results nil) > results > > (add-variable-watcher 'test (lambda (&rest args) > (push args results))) > nil > > (let ((test 99)) > (set 'test 66)) > 66 > > results > ((test 100 set nil) (test 66 set #) (test 99 let #)) > ;; there should be an unlet and the others should not have a 'where'!!!!!!!!! > ;; Every let should have a corresponding unlet so a watcher function can relieve > ;; it's activity (if so desired) of watching its variable in a particular buffer > ;; and then resume it after the unlet occurs in that particular buffer. > ;; Also, in this example the 'let' is acting on the default value as this is a > ;; 'let_shadows_default' case. The 'let','set', and 'unlet' all act on the default for > ;; all variables that do not have their own value. It should not have a 'where'. > > ------------------------------------------- > - LIS let and set in some buffer. (shadows default) > ------------------------------------------- > (defvar-local test 5) > test > > (defvar results nil) > results > > (add-variable-watcher 'test (lambda (&rest args) > (push args results))) > nil > > (with-temp-buffer > (let ((test 99)) > (set 'test 66))) > 66 > > results > ((test 5 set nil) (test 66 set #) (test 99 let #)) Stefan, any comments?