From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#41988: 28.0.50; Edebug unconditionally instruments definitions with &define specs Date: Mon, 5 Apr 2021 16:32:16 +0200 Message-ID: References: <6D19F14E-0133-4751-B0BD-EC2A73C1D21F@gmail.com> <3619E155-8F06-4F8F-B239-121ED3D164A8@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35320"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41988@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 05 17:15:20 2021 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 1lTQwh-00094V-PG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 17:15:19 +0200 Original-Received: from localhost ([::1]:60128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTQwg-0005kU-P1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Apr 2021 11:15:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTQHn-0001cW-Rd for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 10:33:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTQHm-0001y3-KF for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 10:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTQHm-0006BO-H2 for bug-gnu-emacs@gnu.org; Mon, 05 Apr 2021 10:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Apr 2021 14:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41988 X-GNU-PR-Package: emacs Original-Received: via spool by 41988-submit@debbugs.gnu.org id=B41988.161763315523728 (code B ref 41988); Mon, 05 Apr 2021 14:33:02 +0000 Original-Received: (at 41988) by debbugs.gnu.org; 5 Apr 2021 14:32:35 +0000 Original-Received: from localhost ([127.0.0.1]:38384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTQHL-0006Ae-3T for submit@debbugs.gnu.org; Mon, 05 Apr 2021 10:32:35 -0400 Original-Received: from mail-oi1-f174.google.com ([209.85.167.174]:47065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTQHJ-0006AR-Q0 for 41988@debbugs.gnu.org; Mon, 05 Apr 2021 10:32:34 -0400 Original-Received: by mail-oi1-f174.google.com with SMTP id m13so11775682oiw.13 for <41988@debbugs.gnu.org>; Mon, 05 Apr 2021 07:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a22nBunIT0Zfr/Wi6yaMYBN+gT4bCqbjFDv19v+LuyM=; b=B9LZA7ML3NzaqfG/XQuTAXOeue2JlwLTM47SHbsqpBPKk2awt4tqujBFAuaCXMYobP L9+uo9MgnMgTrE/qFqIU05ratmpeCUf2r7vjb6qpOVdY3g5x9ROOle4hmMcqvr6wcZPk aCE4lFoqzam8U7hNUEYRBAmPgj3GPXCUpqSmQlJeVIFNvFen5ss+zOSsyrhKfxFLv9HJ HEfbxL2RbWk/Gm2xcFjKeXH5SPkJtCrfnedKjSMQvC0W7ZdqdDPY6Mqct+FKn62h3QPM 26XsS8dsQZRlzNAVEvLe5zDJMe/BAZHJiGvlw8Q7zyLzU+cuRu1oMNRTmVX5RaBDciGp cjfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a22nBunIT0Zfr/Wi6yaMYBN+gT4bCqbjFDv19v+LuyM=; b=rsK33gxIDvuhP5DkJUyv+PDsKqhhgc5ga6IYw7VwIdbZU97gQmqTBYyrcKEyWuvQoE auIuZWqOxXg2v6n/kQLu0I0sbEe/Az0Xf7Q6rCYIQuIVGl5eCTyKURsxUB0sJfyN8mlv VUOakyHtYee59nFxzIBsVUgvC/KctygDA3Qhy0Ye6pYrVJ/6ZSjZMAkbrSc5iLFITE4h rFJMovAfviJae51+7RI1c8jbxVkDuzJQvOX3mrZ5jBsN1ib0dQorPB2dh1Pahma/m2et xT9fWgD+VFfEKFou/r9slZp5ZWJNpdp2eVf4/kiUT9VEfQkcBGvarAkn68dfT47loDFk BIfw== X-Gm-Message-State: AOAM530tiirpHgtqN74esLpZZ+JBVEFbEabv9iiwzxR7Je0JooSjbDor 03rg7Qb30GvXWdHu5G57SP8iDk7Irf+3X45p5E4= X-Google-Smtp-Source: ABdhPJwECvp2eg1NKI9YfIIKnmkxvsQfGpJXBR0LE9F/vmbNV3h8tbKh2gWLZThNARut9/i0OFpdo9vMdNpwQkhomYw= X-Received: by 2002:aca:6543:: with SMTP id j3mr18510830oiw.158.1617633147856; Mon, 05 Apr 2021 07:32:27 -0700 (PDT) In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:203596 Archived-At: Am So., 4. Apr. 2021 um 22:16 Uhr schrieb Stefan Monnier : > > >> [ 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." > > [ Yes, that's the part I understand. But it's not clear where > backtracking is possible and where it's not. At least, the code that > I saw in edebug.el didn't match my expectations back when I looked at > it, hence my not feeling quite sure what the semantics are (and/or > should be). > IIRC the issue was that the scope of that effect wasn't clear: if you > think of Prolog's cut, its effect is local to a particular definition, > whereas I think the scope of `gate` is not nearly as clear because > there isn't such a notion of "definition". ] I agree that the code isn't terribly clear and probably has some bugs. However, the "prevent backtracking through gates" seems to work at least somewhat (experimentally, in this case I can turn the double definition into an error). > >> > 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. > > What I meant is that a gate would just make the old cl-flet spec fail in > most cases, with no explanation why that spec now fails even though it > worked in the past. Yes, we'd need to at least announce the change in NEWS as an incompatible Lisp change. However, I think overall that's still better than the current situation: with your fix to cl-flet the problematic constructs shouldn't occur any more in the Emacs codebase, and I wouldn't expect such constructs to be very frequent "in the wild", so the overall breakage would be very small, and if it can avoid similarly subtle bugs then I think it's warranted.