From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: emacs-26: `with-eval-after-load' docstring omission
Date: Tue, 27 Feb 2018 15:58:05 -0500 [thread overview]
Message-ID: <jwvy3jeqi3d.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 827ed6de-fd90-144e-53dd-50163a937b63@gmail.com
>> Isn't that an irrelevant implementation detail? I don't see why it
>> should be documented.
> It is relevant, because the behavior isn't the same as 'eval'-ing
> a quoted form.
Yes, the behavior would be different if we quoted the expression and
passed it to `eval`, but in both cases it's an internal implementation
detail, and the relevant difference is the resulting change in
the semantics.
> But I don't think the documentation should be fixed; instead, I think the
> behavior should be changed :)
I think you're blinded by your current problem.
Try and remember the world of Coq. Think about equivalences like
(defun FUN () EXP)
(with-eval-after-load FILE (FUN))
=
(with-eval-after-load FILE EXP)
which are currently true (to the extent such things can be true in
Elisp where FUN can be redefined, of course) whereas
(defun FUN () EXP)
(eval-after-load FILE '(FUN))
≠
(eval-after-load FILE 'EXP)
[ Well, of course, this equivalence is actually true as well given the
current compiler-macro, but I'm assuming above that we undo this
compiler macro. ]
IOW, the behavior you seem to want is semantically a good bit more messy.
In your case, you do want the quote because you need to delay
macro-expansion, but I think it's cleaner to solve this problem by
*explicitly* using a quote, rather than by relying on the messy
semantics of the macro/function you happen to be using.
E.g. your exact same problem could show up if you used, say,
(add-hook 'flycheck-mode-hook ...)
instead of
(with-eval-after-load ...)
but you wouldn't ask for a change in add-hook to "solve" your problem.
Stefan
next prev parent reply other threads:[~2018-02-27 20:58 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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy3jeqi3d.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).