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: Stefan Monnier
Subject: Re: emacs-26: `with-eval-after-load' docstring omission
Date: Fri, 13 Apr 2018 18:43:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> But in the case of flycheck-define-command at least, I don't see much
>> benefit to having it be a macro instead of some inert data in
>> a variable.
> Except that form (flycheck-define-checker) defines a variable, too, right?
> That is, it expands to a defvar and a function call.

So what?  You can just as well define those variables while iterating
down a list of checker-definitions.

> The concrete issue stems from users copying a form from flycheck.el intto
> their init file, without macro-expanding it.  Of course, we can recommend
> that users copy the macro-expanded version (the defvar + the function call)
> — but that's not ideal, because not many of our users know how to do that
> (macroexpand a form).  And macroexpanding all uses in flycheck.el isn't an
> option either.

If you replace flycheck.el's

    (flycheck-define-checker checker1 args1)
    (flycheck-define-checker checker2 args2)
    [...]

into

    (defconst flycheck-builtin-checkers
      '((checker1 args1)
        (checker2 args2)
        ...))

then people will still be able to copy&paste between flycheck.el and
their own

    (setq flycheck-extra-checkers ...)

and if they don't want to `setq` you can autoload the var to be nil so
they can use `push` or `add-to-list` on it.


-- Stefan




reply via email to

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