emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding use-package to ELPA


From: Stefan Monnier
Subject: Re: Adding use-package to ELPA
Date: Mon, 07 Mar 2022 13:01:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> I'll just throw in a request of mine: make it so `flymake-mode` gets
> usable feedback when used in an init file.

To make it more concrete.
Currently if your init file contains just:

    ;;; -*- lexical-binding: t -*-
    (setq smtpmail-smtp-service 587)

and you enable `flymake-mode`, it will complain:

    assignment to free variable ‘smtpmail-smtp-service’

There's no much we can do about it in general.
With Setup/Leaf/use-package, OTOH, the user would presumably write
something like:

    ;;; -*- lexical-binding: t -*-
    (setup smtpmail
      (setq smtpmail-smtp-service 587))

which does provide the link between `smtpmail-smtp-service` and the
`smtpmail.el` file necessary for Emacs to be able in theory to discover
that `smtpmail-smtp-service` is not just some unknown free variable.

Currently, the above snippet using Setup still gives the same
warning, tho.

So `setup.el` could maybe do something like:

    (defmacro setup (pkg &rest args)
      (when (we-are-byte-compiling-p)
        (require (byte-run-strip-symbol-positions pkg)))
      ...)

so as to silence the warning.


        Stefan




reply via email to

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