emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-26: `with-eval-after-load' docstring omission


From: Vicente Vera
Subject: Re: emacs-26: `with-eval-after-load' docstring omission
Date: Sun, 4 Mar 2018 16:04:44 +0000

“Hmm. eval-after-load doesn't pass forms through eval, actually,
AFAICT (it uses a lambda, just like with-eval-after-load)”

“The whole point of with-eval-after-load is that it doesn't do the
"double evaluation" of eval-after-load (which was a frequent source of
errors/confusion).”

Indeed. So the difference between the two is:
- ‘with-eval-after-load’ calls ‘eval-after-load’ to run BODY as a
  function. Conveniently, there's no need to quote nor wrap
  expressions in a lambda form.
- ‘eval-after-load’ runs FORM as a function in both cases: if FORM is
  a function or a quoted expression. The latter is the "double
  evaluation" case: ‘eval-after-load’ is called twice to wrap FORM as
  a function.

Still, an elaboration on the behavior of ‘with-eval-after-load’ could
be useful. Something like: "BODY will be called as a function with no
arguments through ‘funcall’." (as per ‘eval-after-load’
docstring). And probably an addition to the last paragraph: "See
‘eval-after-load’ for more details about... and how BODY will be
evaluated.".


2018-03-03 15:06 GMT+00:00 Vicente Vera <address@hidden>:
> (In reply to Stefan.)
>
> No, there is no specific issue involved. Just some harmless and
> temporary confusion, that's all.
>
> After reading ‘with-eval-after-load’ docstring (which just says
> "Execute BODY after FILE is loaded.") I expected that BODY would be
> executed just like in ‘eval-after-load’, which by default passes forms
> to ‘eval’.
>
> My argument is that there are implicit behaviours that *might* lead to
> wrong assumptions. In my case, I had to look at ‘with-eval-after-load’
> code and re-read ‘eval-after-load’ docstring to clearly understand the
> differences.
>
>
> 2018-02-23 13:42 GMT+00:00 Vicente Vera <address@hidden>:
>> Hello.
>>
>> Currently, ‘with-eval-after-load’ docstring doesn't mention that BODY
>> is executed as a lambda expression through funcall. The docstrings
>> refers to ‘eval-after-load’ regarding the FILE argument, but not how
>> BODY is executed.



reply via email to

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