unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: emacs-26: `with-eval-after-load' docstring omission
Date: Sat, 17 Mar 2018 10:19:22 -0400	[thread overview]
Message-ID: <jwvk1ua23s9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <e281dd73-cbd7-abb7-91f9-dc9769612754@gmail.com> ("Clément Pit-Claudel"'s message of "Sat, 17 Mar 2018 02:01:33 -0400")

>   (with-eval-after-load 'flycheck
>     (push "npx" (flycheck-checker-get 'javascript-eslint 'command)))
>
>   Debugger entered--Lisp error: (void-function \(setf\ flycheck-checker-get\))
>     (\(setf\ flycheck-checker-get\) (cons "npx" (flycheck-checker-get 'javascript-eslint 'command)) 'javascript-eslint 'command)

Yes, in this specific case, flycheck could actually make it work by defining
a (setf flycheck-checker-get) function.

> What do we gain from byte-compiling the bodies of with-eval-after-load forms?

As mentioned before: cleaner semantics.  Macro-expanding the body of
with-eval-after-load more lazily (which is the core of the problem
you're hitting) won't help you if you happened to write your code as:

    (defun my-after-flycheck ()
      (push "npx" (flycheck-checker-get 'javascript-eslint 'command)))
    (with-eval-after-load 'flycheck
      (my-after-flycheck))

> Maybe we can find a way to prevent macro-expansion issues and make the
> behavior more intuitive?

I'd suggest to start by trying to find a way to get the behavior you
want *without* relying on (with-)eval-after-load (which is fiddly in any
case for all kinds of reasons.  It's a handy tool when you need it, but
if you need it I consider that it's usually a sign that there's
a problem elsewhere).
Of course, this may require changes in flycheck.


        Stefan



  reply	other threads:[~2018-03-17 14:19 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 [this message]
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=jwvk1ua23s9.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=cpitclaudel@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 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).