GNU bug report logs - #39385
Erroneous interaction of eval-when-compile and condition-case

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sat, 1 Feb 2020 21:48:02 UTC

Severity: normal

Tags: notabug

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 39385 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 39385 <at> debbugs.gnu.org
Subject: Re: bug#39385: Erroneous interaction of eval-when-compile and
 condition-case
Date: Sat, 01 Feb 2020 20:04:11 -0500
Alan Mackenzie <acm <at> muc.de> 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 <CR> bad-eval-when-compile.el <CR>.  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).




This bug report was last modified 5 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.