emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing a cl-defstruct definition in a published package


From: Jake
Subject: Re: Changing a cl-defstruct definition in a published package
Date: Thu, 19 Jul 2018 16:27:19 -0400

I've seen another work around to detect whether or not a file is being byte-compiled in use-package: (bound-and-true-p byte-compile-current-file)

It seems to work, as illustrated by this example:

(message
 (eval-when-compile
   (if (bound-and-true-p byte-compile-current-file)
       "I'm being byte-compiled!"
     "I'm being evaluated :(")))

When I byte compile that and then evaluate

(progn
  (load-file "~/byte-compile-test.elc")
  (load-file "~/byte-compile-test.el"))

It prints out

Loading /Users/jake.waksbaum/byte-compile-test.elc...
I’m being byte-compiled!
Loading /Users/jake.waksbaum/byte-compile-test.elc...done
Loading /Users/jake.waksbaum/byte-compile-test.el (source)...
I’m being evaluated :(
Loading /Users/jake.waksbaum/byte-compile-test.el (source)...done
t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]