GNU bug report logs - #70186
Variable watcher notification bugs for "local if set" variables. Fix and ert in email to follow. (5 of 9)

Previous Next

Package: emacs;

Reported by: Robert Burks <rburksdev <at> gmail.com>

Date: Thu, 4 Apr 2024 09:18:06 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Burks <rburksdev <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70186 <at> debbugs.gnu.org
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
> From: Robert Burks <rburksdev <at> gmail.com>
> 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 #<buffer *scratch*>) (test 99 let #<buffer *scratch*>))
> ;; 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 #<killed buffer>) (test 99 let #<killed buffer>))

Stefan, any comments?




This bug report was last modified 1 year and 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.