unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70186: Variable watcher notification bugs for "local if set" variables. Fix and ert in email to follow. (5 of 9)
@ 2024-04-04  8:46 Robert Burks
  2024-04-06  7:37 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Burks @ 2024-04-04  8:46 UTC (permalink / raw)
  To: 70186

[-- Attachment #1: Type: text/plain, Size: 2361 bytes --]

(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>))

[-- Attachment #2: Type: text/html, Size: 2778 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-06  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04  8:46 bug#70186: Variable watcher notification bugs for "local if set" variables. Fix and ert in email to follow. (5 of 9) Robert Burks
2024-04-06  7:37 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).