Subject: Re: bug#65035: 29.1; Port flycheck-emacs-lisp-initialize-packages to flymake

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Nov 2024 11:19:15 +0200

> From: Pengji Zhang <[email-masked]>
> Cc: [email-masked], João Távora
>  <[email-masked]>, Eli Zaretskii
>  <[email-masked]>
> Date: Fri, 25 Oct 2024 19:50:48 +0800
> 
> João Távora <[email-masked]> writes:
> 
> > Feel free to use my patch of course.  Stefan noted some time ago
> > that -f package-initialize is the wrong flag to ask Emacs -Q to use
> > elpa though, so there's something better.
> 
> Thanks! I prepared a new patch based on yours.

Thanks.  Spencer, any comments?

> +(defcustom elisp-flymake-byte-compile-activate-packages
> +  #'elisp-flymake-byte-compile-user-file-p
> +  "Whether to activate packages for Flymake elisp byte-compilation.
> +If the value is nil, do not activate installed packages.  If the value
> +is a function, it is called with one argument, the source buffer to be
> +checked, and installed packages are activated if the function returns
> +non-nil.  Otherwise, packages are always activated.
> +
> +Note that for efficiency the return value of the predicate function is
> +cached the first time it is called.  Type \\[revert-buffer-quick] to
> +invalidate the cached value."

I think the doc string should explicitly mention
elisp-flymake-byte-compile-user-file-p, since it is used as the
default value of the option.

> +  :type '(choice
> +          (const :tag "Don't activate" nil)
> +          (const :tag "Always activate" t)
> +          (const :tag "Activate for user files"
> +                 elisp-flymake-byte-compile-user-file-p)
> +          (function :tag "Predicate function"))
> +  :group 'lisp)

Please add a :version tag here.