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: Clément Pit-Claudel
Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations
Date: Mon, 26 Feb 2018 12:32:27 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-02-26 12:13, Stefan Monnier wrote:
>> My user's problem is the following: Flycheck defines a macro that lets
>> you define a new checker.  One of our users wrote something like this:
>>
>> (with-eval-after-load 'flycheck
>>   (flycheck-define-checker
>>     …))
>>
>> This doesn't work.  I claim that it should, or that it should be
>> documented to not work.  Do you disagree?
> 
> I think it is or should be documented, indeed, but not in
> `with-eval-after-load` since this applies to everything else as well.

Got it.

> If you need to use a macro that's in file `foo`, then AFAIK you have
> 2 options:
> 
> - (require 'foo), either directly or transitively.
> - hide your macro call behind a quote so it can't be compiled before
>   `foo` is loaded (regardless of whether you do compile or not
>   irrelevant: the right way to think about it is "what happens when it
>   gets compiled").

Thanks, that makes sense.

My claim is that there could (should?) be a third option: hide the macro call 
in a with-eval-after-load block, and that your second point should cover 
eval-after-load: I find it especially confusing that eval-after-load bypasses 
the quote.





reply via email to

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