Dealing with a one-file elisp package, I wonder if there is a nice way to see unused functions and variables after some major refactoring. I can go through the code and do xref-find-references. But maybe there is an easier way to get a quick overview, even for the price of false positives.

1 Answer 1


Byte-compiling the file will show you warnings about unused lexically-bound variables. But it won't let you know whether dynamically bound things (variables, including options; functions; macros) are "used" in the same file.

(This is normal, since they might well be used by other code, outside the file. E.g. maybe you define a command that anyone can use, but no code in your file calls that function.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.