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: John Wiegley
Subject: Re: Adding use-package to ELPA
Date: Mon, 07 Mar 2022 10:42:24 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)

>>>>> "SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes:

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

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

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

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

SM>     assignment to free variable ‘smtpmail-smtp-service’

Ah, I understand what you mean now.

In use-package, this is exactly what the `:defines` keyword was created for,
so that you can indicate to the byte-compiler which variables will be defined
when the module is loaded.

This special handling is done in `use-package-normalize-keywords`, so one
could advise that function to intercept the list yielded by :defines and do
what's necessary to satisfy flymake. That is, if :defines itself isn't already
enough.
        
-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



reply via email to

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