unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: 39385@debbugs.gnu.org
Subject: bug#39385: Erroneous interaction of eval-when-compile and condition-case
Date: Sat, 01 Feb 2020 20:04:11 -0500	[thread overview]
Message-ID: <87o8uhby0k.fsf@gmail.com> (raw)
In-Reply-To: <20200201214731.GA11168@ACM> (Alan Mackenzie's message of "Sat, 1 Feb 2020 21:47:31 +0000")

Alan Mackenzie <acm@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).





  reply	other threads:[~2020-02-02  1:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01 21:47 bug#39385: Erroneous interaction of eval-when-compile and condition-case Alan Mackenzie
2020-02-02  1:04 ` Noam Postavsky [this message]
2020-02-02 13:20   ` Alan Mackenzie
2020-02-02 15:37   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8uhby0k.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=39385@debbugs.gnu.org \
    --cc=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).