See the answer by Drew for a general description of compiler warnings pertaining to free variables.
In your particular case, however, the culprit is the package oauth2.el
, which for some reason is getting loaded during the byte-compilation of your user-init-file
(perhaps you are a use-package
user?).
In this case adding (defvar foo)
to your user-init-file
will not make the warnings go away. Instead, you could try assigning a value to the corresponding variables before the oauth2
package is loaded in your user-init-file
, e.g.
(eval-when-compile
(defvar oauth--token-data ())
Update
I removed my suggestion to raise the issue with the oauth2
package from my answer, as byte-compiling the package on its own does not raise the warnings mentioned. In my case, at least, the warnings only appear because of the way use-package
loads files before byte-compiling user settings, and I'm not entirely sure why, though it's related to the fact that all variables mentioned are void, i.e. they have been defined with defvar
but not assigned a value.
M-.
, but that will probably fail if you haven't loaded the file that defines the offending variable yet.after-init-time
tot
at the top of your .emacs does the warning get a filename? (refer Re: "reference to free variable" only during initialization, continued here)