From unknown Sun Jun 22 20:58:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Resent-From: David Engster Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2013 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13813@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136181163820278 (code B ref -1); Mon, 25 Feb 2013 17:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2013 17:00:38 +0000 Received: from localhost ([127.0.0.1]:49851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA1Pl-0005Gu-Op for submit@debbugs.gnu.org; Mon, 25 Feb 2013 12:00:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50666) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA1Pj-0005Gm-8Q for submit@debbugs.gnu.org; Mon, 25 Feb 2013 12:00:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA1O4-000750-Hg for submit@debbugs.gnu.org; Mon, 25 Feb 2013 11:58:50 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.5 required=5.0 tests=BAYES_00,FROM_12LTRDOM, RP_MATCHES_RCVD, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA1O4-00074q-BH for submit@debbugs.gnu.org; Mon, 25 Feb 2013 11:58:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA1O1-0000GL-Dj for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:58:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA1Nz-00073U-Pa for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:58:45 -0500 Received: from randomsample.de ([83.169.19.17]:50760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA1Nz-00073F-Ax for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:58:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=3KXa5aZ8cDookTKt37o6rTA4blqhHe0CcDb9P0TAJRI=; b=KHiyDCkzNK8JFLNqfWx1bJERghZPcYyz12/vF1h8q+45h+D4sORZMCK13Y05Q9qV238tIzQJi3WsFE9gvS6mgji/i+d3+uPzpuZsN1UiZ8BcwDUSub1zo9Fhx78U7TB8; Received: from dslc-082-082-165-164.pools.arcor-ip.net ([82.82.165.164] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UA1Nx-0006up-VE for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 17:58:42 +0100 From: David Engster Date: Mon, 25 Feb 2013 17:58:41 +0100 Message-ID: <87d2vo5nzy.fsf@engster.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Recipe: * Create a file test.el with the following contents: (defvar myflag nil) (defmacro mytestmacro () "An eval-and-compile test." `(eval-and-compile (mytestfun))) (defun mytestfun () (when myflag (message "foo"))) (let ((myflag t)) ;; Should display "foo" (mytestmacro)) * Now call with Emacs from trunk: emacs --batch -l test.el * "foo" should be displayed, but isn't. The Emacs 24.2.93 pretest however works as expected. * Note the following: - It works if you just 'setq' the 'myflag' variable - If you load the file interactively and call `eval-buffer', it will also output nothing. However, if you manually evaluate the last expression through C-x C-e, it will work. - The same problem occurs with `eval-when-compile', but everything works with `progn'. Best, David "who will never grasp eval-and-compile" And yes, Stefan, this bug turned up in the EIEIO test suite. :-) From unknown Sun Jun 22 20:58:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2013 20:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: David Engster Cc: 13813@debbugs.gnu.org Received: via spool by 13813-submit@debbugs.gnu.org id=B13813.136182570512402 (code B ref 13813); Mon, 25 Feb 2013 20:56:01 +0000 Received: (at 13813) by debbugs.gnu.org; 25 Feb 2013 20:55:05 +0000 Received: from localhost ([127.0.0.1]:50060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA54j-0003Dz-Gx for submit@debbugs.gnu.org; Mon, 25 Feb 2013 15:55:05 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:32289) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA54h-0003Dr-J1 for 13813@debbugs.gnu.org; Mon, 25 Feb 2013 15:55:04 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+KLv/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kLodwBsEtkQoDiGGcGYFegxU X-IPAS-Result: Av8EABK/CFHO+KLv/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kLodwBsEtkQoDiGGcGYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2432090" Received: from 206-248-162-239.dsl.teksavvy.com (HELO pastel.home) ([206.248.162.239]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 25 Feb 2013 15:53:20 -0500 Received: by pastel.home (Postfix, from userid 20848) id 9DB196C0A9; Mon, 25 Feb 2013 15:53:21 -0500 (EST) From: Stefan Monnier Message-ID: References: <87d2vo5nzy.fsf@engster.org> Date: Mon, 25 Feb 2013 15:53:21 -0500 In-Reply-To: <87d2vo5nzy.fsf@engster.org> (David Engster's message of "Mon, 25 Feb 2013 17:58:41 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Recipe: > * Create a file test.el with the following contents: > (defvar myflag nil) > (defmacro mytestmacro () > "An eval-and-compile test." > `(eval-and-compile (mytestfun))) > (defun mytestfun () > (when myflag > (message "foo"))) > (let ((myflag t)) > ;; Should display "foo" > (mytestmacro)) > * Now call with Emacs from trunk: > emacs --batch -l test.el > * "foo" should be displayed, but isn't. The Emacs 24.2.93 pretest > however works as expected. OK, you got me, I admit it, my recent change to eval-and-compile makes it a lie. Basically, there are now 3 different times: - compile-time - load-time (aka "eager-macroexpansion") - eval-time Most eval-and-compile are used for definitions which are used in macros (hence needed for both compile-time and load-time). For this reason, I changed recently eval-and-compile to be (in effect) eval-during-load-and-compile. I could turn it into a eval-during-eval-load-and-compile, but then your above test would run `mytestfun' twice (once with myflag=nil and then once with myflag=t) which I don't think would please everyone either. > * Note the following: > - It works if you just 'setq' the 'myflag' variable But not if you (progn (setq myflag t) (mytestmacro)). The issue is whether the setq takes place in a separate top-level expression, in which case it's run before eager-macroexpansion of the expression that does the (mytestmacro). > - The same problem occurs with `eval-when-compile', but everything > works with `progn'. Yes, it's basically the same problem. > And yes, Stefan, this bug turned up in the EIEIO test suite. :-) Could you give some details, so we can better assess the best solution? BTW, I think eval-and-compile should only be used to wrap definitions. Anything else is asking for trouble. Stefan From unknown Sun Jun 22 20:58:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Resent-From: David Engster Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2013 21:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 13813@debbugs.gnu.org Received: via spool by 13813-submit@debbugs.gnu.org id=B13813.136182718114665 (code B ref 13813); Mon, 25 Feb 2013 21:20:02 +0000 Received: (at 13813) by debbugs.gnu.org; 25 Feb 2013 21:19:41 +0000 Received: from localhost ([127.0.0.1]:50090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA5SW-0003oS-2T for submit@debbugs.gnu.org; Mon, 25 Feb 2013 16:19:41 -0500 Received: from randomsample.de ([83.169.19.17]:49339) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA5SS-0003oK-VW for 13813@debbugs.gnu.org; Mon, 25 Feb 2013 16:19:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=2Ars+O0s5KdxMqPdme2RDtOBVpeDyfGCJpB+Lw43OMI=; b=OWDMhAMFlLRfHWMcA2bMLbsC4UbQsMzshCZOrGfkgZzWQNrAGreOxFYkrqxjrgbOK3wGKFhE6lSLn3dg/xMdGPF68qchkBO2300CZl+lH5BjU/XsjII6HYq3fkOE6Hus; Received: from dslc-082-082-165-164.pools.arcor-ip.net ([82.82.165.164] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UA5Qn-0002XR-P2; Mon, 25 Feb 2013 22:17:53 +0100 From: David Engster In-Reply-To: (Stefan Monnier's message of "Mon, 25 Feb 2013 15:53:21 -0500") References: <87d2vo5nzy.fsf@engster.org> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.93 (gnu/linux) Mail-Copies-To: never Date: Mon, 25 Feb 2013 22:17:53 +0100 Message-ID: <874nh05bzy.fsf@engster.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Stefan Monnier writes: > OK, you got me, I admit it, Ha! No one can escape the EIEIO testsuite! > I changed recently eval-and-compile to be (in effect) > eval-during-load-and-compile. I could turn it into a > eval-during-eval-load-and-compile, but then your above test would run > `mytestfun' twice (once with myflag=nil and then once with myflag=t) > which I don't think would please everyone either. Yep, my gut says that would create problems in EIEIO, too. >> * Note the following: >> - It works if you just 'setq' the 'myflag' variable > > But not if you (progn (setq myflag t) (mytestmacro)). True. I didn't test that. >> And yes, Stefan, this bug turned up in the EIEIO test suite. :-) > > Could you give some details, so we can better assess the best solution? There is a flag called `eieio-error-unsupported-class-tags' which makes `eieio-defclass' signal an error if a tag is unsupported. Since `eieio-defclass' is the implementation of the `defclass' macro (wrapped in `eval-and-comopile'), this flag has no effect if it is set in a let-binding. To be specific, the test checks that this (let ((eieio-error-unsupported-class-tags t)) (defclass class-error () ((error-slot :initarg :error-slot :badslottag 1)) "A class with a bad slot tag.")) is throwing an error. > BTW, I think eval-and-compile should only be used to wrap definitions. > Anything else is asking for trouble. As I said: I can't wrap my head around that stuff. But the Emacs Lisp manual specifically mentions this use case for `eval-and-compile'. Out of curiosity I removed the `eval-and-compile' and everything seems to work fine, which just adds to my confusion. -David From unknown Sun Jun 22 20:58:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 18:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13813@debbugs.gnu.org Received: via spool by 13813-submit@debbugs.gnu.org id=B13813.136302578021665 (code B ref 13813); Mon, 11 Mar 2013 18:17:01 +0000 Received: (at 13813) by debbugs.gnu.org; 11 Mar 2013 18:16:20 +0000 Received: from localhost ([127.0.0.1]:46703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF7Gm-0005dO-FF for submit@debbugs.gnu.org; Mon, 11 Mar 2013 14:16:20 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:59522) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF7Gk-0005dB-CV for 13813@debbugs.gnu.org; Mon, 11 Mar 2013 14:16:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEuzWDWRdzgh4BAQQBVigLCzQSFBgNiEIGwS2NYYMpA6R6gV6DEw X-IPAS-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEuzWDWRdzgh4BAQQBVigLCzQSFBgNiEIGwS2NYYMpA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="4237703" Received: from 206-248-162-253.dsl.teksavvy.com (HELO ceviche.home) ([206.248.162.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Mar 2013 14:15:15 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 155FF660E5; Mon, 11 Mar 2013 14:15:17 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87d2vo5nzy.fsf@engster.org> <874nh05bzy.fsf@engster.org> Date: Mon, 11 Mar 2013 14:15:17 -0400 In-Reply-To: <874nh05bzy.fsf@engster.org> (David Engster's message of "Mon, 25 Feb 2013 22:17:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) > There is a flag called `eieio-error-unsupported-class-tags' which makes > `eieio-defclass' signal an error if a tag is unsupported. Since > `eieio-defclass' is the implementation of the `defclass' macro (wrapped > in `eval-and-comopile'), this flag has no effect if it is set in a > let-binding. To be specific, the test checks that this > (let ((eieio-error-unsupported-class-tags t)) > (defclass class-error () > ((error-slot :initarg :error-slot > :badslottag 1)) > "A class with a bad slot tag.")) > is throwing an error. My opinion (expressed in eieio.el via: "FIXME: Most of this should be moved to the `defclass' macro.") is that this tag-checking should be done when expanding the `defclass' macro rather than when running eieio-defclass. So clearly, your let-binding wouldn't affect it when the code is byte-compiled (or when it's eagerly macroexpanded). IOW, to be sure to get what you want, you need to be more explicit, as in: (let ((eieio-error-unsupported-class-tags t)) (eval '(defclass class-error () ((error-slot :initarg :error-slot :badslottag 1)) "A class with a bad slot tag."))) -- Stefan From unknown Sun Jun 22 20:58:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Resent-From: David Engster Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 13813@debbugs.gnu.org Received: via spool by 13813-submit@debbugs.gnu.org id=B13813.13630355063551 (code B ref 13813); Mon, 11 Mar 2013 20:59:02 +0000 Received: (at 13813) by debbugs.gnu.org; 11 Mar 2013 20:58:26 +0000 Received: from localhost ([127.0.0.1]:46890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF9ne-0000vD-56 for submit@debbugs.gnu.org; Mon, 11 Mar 2013 16:58:26 -0400 Received: from randomsample.de ([83.169.19.17]:38569) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF9nb-0000v5-HO for 13813@debbugs.gnu.org; Mon, 11 Mar 2013 16:58:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=no9LSCP3Us762/aN5CdRArufMwgAuhOK9mLyYlj1jBA=; b=QLOyjOhLXf8ijIGDTAgHeWCsPfCTst/sixsnFdQCexLj3LAC/Qk2XUvKZs/6MXWkOCHMpNzIMAcxZ7qP7pjPCGLwwcPm0QJLOlxG+M5Y5MLDZDOIdhidczQPiOU8v/ei; Received: from dslc-082-082-164-249.pools.arcor-ip.net ([82.82.164.249] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UF9me-0000Uy-2S; Mon, 11 Mar 2013 21:57:25 +0100 From: David Engster In-Reply-To: (Stefan Monnier's message of "Mon, 11 Mar 2013 14:15:17 -0400") References: <87d2vo5nzy.fsf@engster.org> <874nh05bzy.fsf@engster.org> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.93 (gnu/linux) Mail-Copies-To: never Date: Mon, 11 Mar 2013 21:57:21 +0100 Message-ID: <87txohwt72.fsf@engster.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) Stefan Monnier writes: >> There is a flag called `eieio-error-unsupported-class-tags' which makes >> `eieio-defclass' signal an error if a tag is unsupported. Since >> `eieio-defclass' is the implementation of the `defclass' macro (wrapped > >> in `eval-and-comopile'), this flag has no effect if it is set in a >> let-binding. To be specific, the test checks that this > >> (let ((eieio-error-unsupported-class-tags t)) >> (defclass class-error () >> ((error-slot :initarg :error-slot >> :badslottag 1)) >> "A class with a bad slot tag.")) > >> is throwing an error. > > My opinion (expressed in eieio.el via: "FIXME: Most of this should be > moved to the `defclass' macro.") is that this tag-checking should be done > when expanding the `defclass' macro rather than when running > eieio-defclass. So clearly, your let-binding wouldn't affect it when > the code is byte-compiled (or when it's eagerly macroexpanded). > > IOW, to be sure to get what you want, you need to be more explicit, as in: > > (let ((eieio-error-unsupported-class-tags t)) > (eval '(defclass class-error () > ((error-slot :initarg :error-slot > :badslottag 1)) > "A class with a bad slot tag."))) So in yet other words, you don't see this as a bug? If so, then please close this report and I'll have to discuss with Eric how we deal with this on our side. -David From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 22:49:18 2013 Received: (at control) by debbugs.gnu.org; 12 Mar 2013 02:49:18 +0000 Received: from localhost ([127.0.0.1]:47199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFFHB-0001bZ-QC for submit@debbugs.gnu.org; Mon, 11 Mar 2013 22:49:18 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:11332) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFFH9-0001bH-MW; Mon, 11 Mar 2013 22:49:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEuzWDWRdzgh4BAQQBVigLCzQSFBgNiEIGwS2NYU2CXAOkeoFegmop X-IPAS-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEuzWDWRdzgh4BAQQBVigLCzQSFBgNiEIGwS2NYU2CXAOkeoFegmop X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="4365021" Received: from 206-248-162-253.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([206.248.162.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Mar 2013 22:48:10 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id E1113AE219; Mon, 11 Mar 2013 22:48:11 -0400 (EDT) From: Stefan Monnier To: 13813-done@debbugs.gnu.org Subject: Re: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Message-ID: References: <87d2vo5nzy.fsf@engster.org> <874nh05bzy.fsf@engster.org> <87txohwt72.fsf@engster.org> Date: Mon, 11 Mar 2013 22:48:11 -0400 In-Reply-To: <87txohwt72.fsf@engster.org> (David Engster's message of "Mon, 11 Mar 2013 21:57:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) tags 13813 notabug thanks > So in yet other words, you don't see this as a bug? If so, then please > close this report and I'll have to discuss with Eric how we deal with > this on our side. Right: the `eval-and-compile' can cause the wrapped code to be run outside of the scope of the surrounding code, so it's normal if that let-binding doesn't always have the effect you want. Stefan From unknown Sun Jun 22 20:58:05 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: David Engster Subject: bug#13813: closed (Re: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable) Message-ID: References: <87d2vo5nzy.fsf@engster.org> X-Gnu-PR-Message: they-closed 13813 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: notabug Reply-To: 13813@debbugs.gnu.org Date: Tue, 12 Mar 2013 02:50:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1363056604-6247-1" This is a multi-part message in MIME format... ------------=_1363056604-6247-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13813@debbugs.gnu.org. --=20 13813: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13813 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1363056604-6247-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13813-done) by debbugs.gnu.org; 12 Mar 2013 02:49:17 +0000 Received: from localhost ([127.0.0.1]:47197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFFHB-0001bW-HI for submit@debbugs.gnu.org; Mon, 11 Mar 2013 22:49:17 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:11332) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UFFH9-0001bH-MW; Mon, 11 Mar 2013 22:49:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEuzWDWRdzgh4BAQQBVigLCzQSFBgNiEIGwS2NYU2CXAOkeoFegmop X-IPAS-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEuzWDWRdzgh4BAQQBVigLCzQSFBgNiEIGwS2NYU2CXAOkeoFegmop X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="4365021" Received: from 206-248-162-253.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([206.248.162.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Mar 2013 22:48:10 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id E1113AE219; Mon, 11 Mar 2013 22:48:11 -0400 (EDT) From: Stefan Monnier To: 13813-done@debbugs.gnu.org Subject: Re: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Message-ID: References: <87d2vo5nzy.fsf@engster.org> <874nh05bzy.fsf@engster.org> <87txohwt72.fsf@engster.org> Date: Mon, 11 Mar 2013 22:48:11 -0400 In-Reply-To: <87txohwt72.fsf@engster.org> (David Engster's message of "Mon, 11 Mar 2013 21:57:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13813-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) tags 13813 notabug thanks > So in yet other words, you don't see this as a bug? If so, then please > close this report and I'll have to discuss with Eric how we deal with > this on our side. Right: the `eval-and-compile' can cause the wrapped code to be run outside of the scope of the surrounding code, so it's normal if that let-binding doesn't always have the effect you want. Stefan ------------=_1363056604-6247-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Feb 2013 17:00:38 +0000 Received: from localhost ([127.0.0.1]:49851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA1Pl-0005Gu-Op for submit@debbugs.gnu.org; Mon, 25 Feb 2013 12:00:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50666) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA1Pj-0005Gm-8Q for submit@debbugs.gnu.org; Mon, 25 Feb 2013 12:00:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA1O4-000750-Hg for submit@debbugs.gnu.org; Mon, 25 Feb 2013 11:58:50 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.5 required=5.0 tests=BAYES_00,FROM_12LTRDOM, RP_MATCHES_RCVD, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA1O4-00074q-BH for submit@debbugs.gnu.org; Mon, 25 Feb 2013 11:58:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA1O1-0000GL-Dj for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:58:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA1Nz-00073U-Pa for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:58:45 -0500 Received: from randomsample.de ([83.169.19.17]:50760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA1Nz-00073F-Ax for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 11:58:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=3KXa5aZ8cDookTKt37o6rTA4blqhHe0CcDb9P0TAJRI=; b=KHiyDCkzNK8JFLNqfWx1bJERghZPcYyz12/vF1h8q+45h+D4sORZMCK13Y05Q9qV238tIzQJi3WsFE9gvS6mgji/i+d3+uPzpuZsN1UiZ8BcwDUSub1zo9Fhx78U7TB8; Received: from dslc-082-082-165-164.pools.arcor-ip.net ([82.82.165.164] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UA1Nx-0006up-VE for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 17:58:42 +0100 From: David Engster To: bug-gnu-emacs@gnu.org Subject: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Date: Mon, 25 Feb 2013 17:58:41 +0100 Message-ID: <87d2vo5nzy.fsf@engster.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Recipe: * Create a file test.el with the following contents: (defvar myflag nil) (defmacro mytestmacro () "An eval-and-compile test." `(eval-and-compile (mytestfun))) (defun mytestfun () (when myflag (message "foo"))) (let ((myflag t)) ;; Should display "foo" (mytestmacro)) * Now call with Emacs from trunk: emacs --batch -l test.el * "foo" should be displayed, but isn't. The Emacs 24.2.93 pretest however works as expected. * Note the following: - It works if you just 'setq' the 'myflag' variable - If you load the file interactively and call `eval-buffer', it will also output nothing. However, if you manually evaluate the last expression through C-x C-e, it will work. - The same problem occurs with `eval-when-compile', but everything works with `progn'. Best, David "who will never grasp eval-and-compile" And yes, Stefan, this bug turned up in the EIEIO test suite. :-) ------------=_1363056604-6247-1--