unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 41988@debbugs.gnu.org
Subject: bug#41988: 28.0.50; Edebug unconditionally instruments definitions with &define specs
Date: Sun, 4 Apr 2021 20:40:11 +0200	[thread overview]
Message-ID: <CAArVCkQ_tGXo2qHC8G091ME5xhnfW7n0nsNTY8raZwNxp_s-hw@mail.gmail.com> (raw)
In-Reply-To: <jwvy2egwpf3.fsf-monnier+emacs@gnu.org>

Am So., 21. März 2021 um 15:37 Uhr schrieb Stefan Monnier
<monnier@iro.umontreal.ca>:
>
> >> - The old spec of `cl-flet` would be broken by such a change, so if we
> >>  want to make such a change, we'd probably want to arrange so that it
> >>  emits a clear warning.
> > Where?  When setting the debug specification (byte-run--set-debug), or in some other place?
>
> The old spec was of the form (or (&define name form) (&define name sexp
> body)), so if we put a gate at `&define`, this will probably fail to even match
> the (&define name sexp body) part.

Correct, this would turn a mismatch into a hard error.

>
> [ Disclaimer: I don't understand the precise semantics of `gate`, tho
>   I do remember using it once via trial-and-error.  So maybe it wouldn't
>   prevent it, but if doesn't prevent it, then it doesn't likely "fix"
>   our problem ;-)  ]

AIUI the semantics of "gate" aren't that complex, it just means "don't
backtrack beyond this point."

>
> >> I'm not sure it's worth the trouble: the pain seems higher than the gain.
> > This bug is rather nasty when it's hit (it took me quite a while to
> > debug/hunt down),
>
> Could you remind me what was this nasty outcome?

The original bug report was
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41853 (extremely subtle
bug due to mismatch between frequency and offset vector). I don't know
whether that problem would appear here as well, but it's nasty enough
that I'd like to prevent duplicate definitions altogether.

> In the context of
> Edebug the effect is negligible (it just emits a spurious message about
> defining an extra something, but other than that debugging works just fine).

That's only true if edebug-new-definition-function handles the
"duplicate definition" case well. For example, to prevent bug#41853 I
bail out on duplicate definitions in
https://github.com/phst/rules_elisp/blob/b67339e66fed8117dc26d4d2fb2ad321c66a3632/elisp/ert/runner.el#L127-L136;
that doesn't work if this bug isn't fixed.

>
> > so I think it would be reasonable to prevent.  We already
> > disable backtracking for literal symbols, and I think forms that require
> > multiple &define forms with backtracking should be exceedingly rare and can
> > be rewritten as you did with cl-flet.
>
> Emitting a warning would be much more helpful than just silently
> "cut"ting the backtracking.

A gate isn't silent, it would cause a hard error in this case.





  reply	other threads:[~2021-04-04 18:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 16:58 bug#41988: 28.0.50; Edebug unconditionally instruments definitions with &define specs Philipp
     [not found] ` <mailman.222.1592758804.2574.bug-gnu-emacs@gnu.org>
2020-06-21 23:48   ` Alan Mackenzie
2020-08-08 11:01     ` Philipp Stephani
2020-08-08 14:59       ` Alan Mackenzie
2020-08-09 11:33         ` Philipp Stephani
2020-08-09 16:35           ` Alan Mackenzie
2020-08-10 13:32             ` Philipp Stephani
2021-03-02 15:59 ` Stefan Monnier
2021-03-02 17:28   ` Philipp Stephani
2021-03-08 16:33     ` Philipp Stephani
2021-03-08 16:37       ` Philipp Stephani
2021-03-08 17:41         ` Stefan Monnier
2021-03-14 16:32           ` Philipp
2021-03-14 17:38             ` Stefan Monnier
2021-03-18 11:19               ` Philipp
2021-03-18 14:01                 ` Stefan Monnier
2021-03-21 13:34                   ` Philipp
2021-03-21 14:37                     ` Stefan Monnier
2021-04-04 18:40                       ` Philipp Stephani [this message]
2021-04-04 20:16                         ` Stefan Monnier
2021-04-05 14:32                           ` Philipp Stephani
2021-04-10 15:07                             ` Philipp
2021-04-10 15:51                               ` Stefan Monnier
2021-04-10 16:23                                 ` Philipp
2021-04-10 17:29                               ` Eli Zaretskii
2021-04-10 18:12                                 ` Stefan Monnier
2021-04-10 19:54                                 ` Philipp

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=CAArVCkQ_tGXo2qHC8G091ME5xhnfW7n0nsNTY8raZwNxp_s-hw@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=41988@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).