From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#65620: void function edebug-after Date: Thu, 31 Aug 2023 09:55:18 +0200 Message-ID: References: <87ledsku08.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="589"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Alan Mackenzie , 65620@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 31 09:58:20 2023 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 1qbcZH-000ATg-RG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 09:58:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbcYt-0004MC-2G; Thu, 31 Aug 2023 03:57:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbcYs-0004Lu-CO for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 03:57:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbcYs-0002LU-4k for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 03:57:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbcYz-0000QZ-QC for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 03:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Aug 2023 07:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65620 X-GNU-PR-Package: emacs Original-Received: via spool by 65620-submit@debbugs.gnu.org id=B65620.16934686671615 (code B ref 65620); Thu, 31 Aug 2023 07:58:01 +0000 Original-Received: (at 65620) by debbugs.gnu.org; 31 Aug 2023 07:57:47 +0000 Original-Received: from localhost ([127.0.0.1]:54802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbcYk-0000Py-Jy for submit@debbugs.gnu.org; Thu, 31 Aug 2023 03:57:46 -0400 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:49248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbcYi-0000Pa-KS for 65620@debbugs.gnu.org; Thu, 31 Aug 2023 03:57:45 -0400 Original-Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-52bca2e8563so582910a12.2 for <65620@debbugs.gnu.org>; Thu, 31 Aug 2023 00:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693468650; x=1694073450; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=zg0Gw1q+oDm6bAx2+tluRvCGCHPrwOQjw/c6ddrjZYs=; b=UwBzL8TdbFedBXsVCsEOcdimM4yHlpthQ6UlU9aobxRGdMcMSbWbiMQsMyFUAj8xGR 1bIBUqKndq3n6UGik+2W0lmqez2fjF/A/+nNVkktGq9WutwhsaWqsmsarH1w3rscFNIN OP6BYV4EtP6fmlnOP5ngbRtwXUUGf7QCWF+l2mZzwLChjxZARxoB8NIRw17Fzz6lfyz5 ST4yjPBBJ28nFetyZr4BgBP2w/Jc1GOt22fPFPuq8dDcvbhhezAxHdxl5o5L3ATHkimn g3er8AJdAoRPBMLwtc8EYWkwV7jxsJSO2s6673psJdo9K+j0m2iuGkoOCRoUBLTukH0u TnYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693468650; x=1694073450; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zg0Gw1q+oDm6bAx2+tluRvCGCHPrwOQjw/c6ddrjZYs=; b=SqEI5NV5ApjH5b7lYRKY6Hhrv8ogRSI9tObj0sc5TNnEiKO49GDbtKqkWJwM1xKjCR +A2+sZgIiooinRcGyqi3JNxBX/LSgYwtFNkTzoXr82T8THLyK9lfCmEYV7kDnPDebaAA Rsonj/MRzYZDFw6JyzcPAOEmyQZqBw/iDQUeTU6rdTiFzS+wS6AXyO5bTcVYGIOjZXy5 +wbg1sahvXDlddDGwqIYt5gCHoKootnnlZ0QxymXYTzKj4eZW4maQhxNGY/eMOFgTlsO 06/8767rGX5qo8s3P8KmAWBJGSjk3l0MTc+AECUkLSOQ08fVhwMudgbFw67R5Zrxk3oa SmRA== X-Gm-Message-State: AOJu0Yxpwz2G3O6J7aw4SAF09lqLMfDNLjGXkoJP0hIKKzIXds2g4A7/ wIDdAP53VreRE3ZByzIxoGI0cEZJwU08anku X-Google-Smtp-Source: AGHT+IFOAZ8B7s1cbjNnQ5duaobxpF3Xg34UwvyYsrwEZljU+pVgq+uPe2Ll9YPhaP5FOZGIz5ZKug== X-Received: by 2002:a17:907:7758:b0:992:3897:1985 with SMTP id kx24-20020a170907775800b0099238971985mr3115180ejc.43.1693468650201; Thu, 31 Aug 2023 00:57:30 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36a8f.dip0.t-ipconnect.de. [217.227.106.143]) by smtp.gmail.com with ESMTPSA id a1-20020a17090682c100b009a1a653770bsm458414ejy.87.2023.08.31.00.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 00:56:21 -0700 (PDT) In-Reply-To: <87ledsku08.fsf@web.de> (Michael Heerdegen's message of "Thu, 31 Aug 2023 01:09:11 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268796 Archived-At: Michael Heerdegen writes: > Alan Mackenzie writes: > >> (defmacro hash-if (condition then-form &rest else-forms) >> "A conditional compilation macro analogous to C's #if. >> Evaluate CONDITION at macro-expansion time. If it is non-nil, >> expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS >> enclosed in a `progn' form. ELSE-FORMS may be empty." >> (declare (indent 2) >> (debug (form sexp &rest sexp))) >> (if (eval condition lexical-binding) >> then-form >> (cons 'progn else-forms))) > > Dunno if someone is able to fix this (I'm not). Until then using > `def-form` `or `sexp` instead of `form` works in a better way (the > former edebugs CONDITION when instrumenting, the latter would omit > edebugging the CONDITION entirely). > > Anyway, the key point in the above example is that macroexpanding (while > instrumenting) combined with the `eval' call seems to lead to the > evaluation of instrumented code outside of an Edebug session when > CONDITION is instrumented using `form`. `eval-when-compile' uses > `def-form` for example - I guess using `form` in this case doesn't work > as one might expect. I think what's happening here is like this: By using 'form' for condition, we're telling edebug to instruments it. That is, the argument eval sees when foo is instrumented is whatever edebug wraps around the condition (< ...), and that contains the eval-after. Using sexp for the condition doesn't instrument the condition. One can follow that in the backtrace. So, I guess there's nothing to fix here.