unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Robert Burks <rburksdev@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 70186@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	[thread overview]
Message-ID: <86msq73ps4.fsf@gnu.org> (raw)
In-Reply-To: <CAHvcHq6iwVdPREKhi4+zwMSc4VCKjTO=bZDimk8op5c9kMMJfg@mail.gmail.com> (message from Robert Burks on Thu, 4 Apr 2024 04:46:07 -0400)

> From: Robert Burks <rburksdev@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?





      reply	other threads:[~2024-04-06  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86msq73ps4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70186@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rburksdev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).