From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#39385: Erroneous interaction of eval-when-compile and condition-case Date: Sun, 2 Feb 2020 13:20:24 +0000 Message-ID: <20200202132024.GB5547@ACM> References: <20200201214731.GA11168@ACM> <87o8uhby0k.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="28622"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 39385@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 02 14:21:18 2020 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 1iyFBc-0007JO-Pr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Feb 2020 14:21:16 +0100 Original-Received: from localhost ([::1]:56044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyFBb-0002tB-Sy for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Feb 2020 08:21:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyFBP-0002st-HS for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 08:21:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyFBO-0005ib-Hg for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 08:21:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyFBO-0005iR-ED for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 08:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iyFBO-0000z2-AS for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 08:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Feb 2020 13:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39385 X-GNU-PR-Package: emacs Original-Received: via spool by 39385-submit@debbugs.gnu.org id=B39385.15806496313710 (code B ref 39385); Sun, 02 Feb 2020 13:21:02 +0000 Original-Received: (at 39385) by debbugs.gnu.org; 2 Feb 2020 13:20:31 +0000 Original-Received: from localhost ([127.0.0.1]:39594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyFAt-0000xl-55 for submit@debbugs.gnu.org; Sun, 02 Feb 2020 08:20:31 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:25254 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iyFAq-0000xb-Mc for 39385@debbugs.gnu.org; Sun, 02 Feb 2020 08:20:29 -0500 Original-Received: (qmail 72933 invoked by uid 3782); 2 Feb 2020 13:20:26 -0000 Original-Received: from acm.muc.de (p2E5D58E7.dip0.t-ipconnect.de [46.93.88.231]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 02 Feb 2020 14:20:24 +0100 Original-Received: (qmail 6425 invoked by uid 1000); 2 Feb 2020 13:20:24 -0000 Content-Disposition: inline In-Reply-To: <87o8uhby0k.fsf@gmail.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:175581 Archived-At: Hello, Noam. On Sat, Feb 01, 2020 at 20:04:11 -0500, Noam Postavsky wrote: > Alan Mackenzie writes: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > (defmacro c-safe (&rest body) > > ;; safely execute BODY, return nil if an error occurred > > `(condition-case nil > > (progn ,@body) > > (error nil))) > > (defmacro foo () > > (error "This message should not be seen")) > > (eval-when-compile > > (c-safe (foo))) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > Now do M-x byte-compile-file bad-eval-when-compile.el . This > > erroneously throws the error: > > This message should not be seen > The same happens without eval-when-compile. > > . This should have been caught by the condition-case generated by > > (c-safe ...). > I don't think so, because the condition-case is in the code generated by > c-safe (because the condition-case is quoted), whereas the error is > signaled while generating the code (because the error call is not > quoted). Ah, I think I've got it. The macro is being expanded before the condition-case is active, and this is when it throws the error. Thanks for the help. I'll close this as notabug. -- Alan Mackenzie (Nuremberg, Germany).