|
From: | Jake |
Subject: | Re: Changing a cl-defstruct definition in a published package |
Date: | Thu, 19 Jul 2018 17:34:07 -0400 |
> (message
> (eval-when-compile
> (if (bound-and-true-p byte-compile-current-file)
> "I'm being byte-compiled!"
> "I'm being evaluated :(")))
Let's say, this is in a file foo.el. And let's say we have a file
bar.el which contains:
(require 'foo)
...
Then byte-compiling bar.el (when foo.el has not been byte-compiled)
will emit a message "I'm being byte-compiled!".
But yes, there are other ways. I think I remember using something like
(setq my-witness t)
(eval-when-compile
(message (if (bound-and-true-p my-witness)
"Loading this file non-compiled"
"Byte-compiling this file")))
(setq my-witness nil)
in the past,
Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |