From: ar0x2ff@gmail.com
To: Philip Kaludercic <philipk@posteo.net>
Cc: 62889@debbugs.gnu.org
Subject: bug#62889: 29.0.60; (setopt ...) does not give "assignment to free variable" warning
Date: Tue, 18 Apr 2023 10:34:27 +0200 [thread overview]
Message-ID: <1849432.tdWV9SEqCh@192.168.1.69> (raw)
In-Reply-To: <87pm813e7k.fsf@posteo.net>
Philip Kaludercic writes:
> var2 should also not be highlighted, since the first argument to the
> function `customize-set-variable' is a symbol, and the byte compiler
> correctly states that it doesn't know that any variable "var2" will be
> defined.
>
> If you macroexpand setopt, you will see that it generates
>
> (setopt--set 'var3 2)
>
> which is all fine, since no functions are being invoked with undefined
> variables.
>
> The reason this makes sense is that not all user options have to be
> loaded when they are set. A number of them are even auto-loaded and
> will load the library for the necessary user-option setters if
> necessary.
I was aware of the "do not overwrite custom variable if set before library
load" mechanism, but I also seem to remember the (customize-set-variable ...)
function to throw "free variable" warnings (e.g. when i open custome.el), so i
kind of took for granted that it was correct behaviour.
Glad to know (setopt ...) works this way! No more warning suppress in my init
file :)
next prev parent reply other threads:[~2023-04-18 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-16 15:59 bug#62889: 29.0.60; (setopt ...) does not give "assignment to free variable" warning ar0x2ff
2023-04-18 6:18 ` Philip Kaludercic
2023-04-18 8:34 ` ar0x2ff [this message]
2023-04-18 19:20 ` Philip Kaludercic
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1849432.tdWV9SEqCh@192.168.1.69 \
--to=ar0x2ff@gmail.com \
--cc=62889@debbugs.gnu.org \
--cc=philipk@posteo.net \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.