Search code examples
emacswarningscompiler-warnings

How to find the cause of "Warning (bytecomp): Unused lexical variable ‘start’" during start-up?


I am not using Emacs (27.2 on macOS, installed via Homebrew) on a regular basis anymore but get the warning

Warning (bytecomp): Unused lexical variable ‘start’

since a few weeks when starting Emacs. I skimmed through my init.el but there is no code using a variable start. So I assume that some package causes this inconvenience. Is there any elegant way to find the source for this warning? I understand what it is about but was wondering wether there is a better way than to either ignore it or to bisect my config file until I find the right spot.


Solution

  • Bisect your init file, commenting out 1/2, then 3/4, 7/8,... till you find the culprit file.

    You can also byte-compile any file, to get clickable warnings - clicking that warning should take you to the problematic unused lexical variable.

    (Keep in mind also that the warning is just that. It doesn't mean that there's necessarily a problem that prevents things from working.)