From: Vicente Vera <vicentemvp@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Re: emacs-26: `with-eval-after-load' docstring omission
Date: Sun, 4 Mar 2018 16:04:44 +0000 [thread overview]
Message-ID: <CAMfbzvDcP52gfvhj5Hd=m68k0oku65juNaOngGwkj4h_fZu7LA@mail.gmail.com> (raw)
In-Reply-To: <CAMfbzvB+CVSOeEEAWkuCk7T+H0mjDT+D+a-X3thR4p2dNiO3Ng@mail.gmail.com>
“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 <vicentemvp@gmail.com>:
> (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 <vicentemvp@gmail.com>:
>> 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.
next prev parent reply other threads:[~2018-03-04 16:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-23 13:42 emacs-26: `with-eval-after-load' docstring omission Vicente Vera
2018-02-23 14:16 ` Noam Postavsky
2018-02-24 14:42 ` Vicente Vera
2018-02-27 20:40 ` Clément Pit-Claudel
2018-02-27 20:58 ` Stefan Monnier
2018-02-28 14:53 ` Clément Pit-Claudel
2018-02-28 23:22 ` Stefan Monnier
2018-03-17 6:01 ` Clément Pit-Claudel
2018-03-17 14:19 ` Stefan Monnier
2018-04-13 16:00 ` Clément Pit-Claudel
2018-04-13 18:02 ` Stefan Monnier
2018-04-13 18:28 ` Clément Pit-Claudel
2018-04-13 18:41 ` Stefan Monnier
2018-04-13 22:43 ` Stefan Monnier
2018-02-27 20:21 ` Stefan Monnier
2018-03-03 15:06 ` Vicente Vera
2018-03-03 15:38 ` Clément Pit-Claudel
2018-03-03 21:52 ` Stefan Monnier
2018-03-04 16:04 ` Vicente Vera [this message]
2018-03-05 3:39 ` Stefan Monnier
2018-03-09 1:00 ` Noam Postavsky
2018-03-09 4:55 ` Stefan Monnier
2018-03-09 0:47 ` Vicente Vera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMfbzvDcP52gfvhj5Hd=m68k0oku65juNaOngGwkj4h_fZu7LA@mail.gmail.com' \
--to=vicentemvp@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.