emacs-devel
[Top][All Lists]
Advanced

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

Re: A combination of defmacro, functionp, and quoted lambdas yields diff


From: Michael Heerdegen
Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations
Date: Wed, 28 Feb 2018 13:44:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> Another option, is to compile that file and then you can do
>
>     (eval-when-compile (require 'flycheck))
>     (with-eval-after-load 'flycheck
>       (flycheck-define-checker
>         …))
>
> it also works if you don't byte-compile, except that the
> with-eval-after-load becomes ineffective.

So that's not really an option.

I fear that this problem, although there are acceptable workarounds,
could be a regularly recurring issue.  It's not an unnatural expectation
that code in `eval-when-compile' is allowed to use all of the stuff
defined in the FILE.  People use this in their init files, not all will
know about the underlying mechanisms, so this is not really optimal.

Would it make sense to introduce an optional argument for
`eval-after-load' that, when non-nil, arranges that the FORM is
untouched until the FILE is loaded, and then compiled and loaded?  

A disadvantage would be that compiling the init file would not warn any
more about problems in the specified FORM.


Michael.



reply via email to

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