I recently got bitten by a deprecated setting breaking a new package I was trying to use. The same behaviour had been reported by a number of users before me, but the authors were unable to reproduce the problem and the prior reporters were unable to isolate the problem.

Is there any mechanism for detecting out of date settings and other constructs in elisp files?

I am primarily thinking about customization settings, but this really applies to elisp code in general


Others will no doubt add more info to help answer this. I'll mention a few things that come to mind.

  1. `M-x customize-changed' shows you a Customize buffer that tells you about stuff that has changed since a given Emacs version:

    Customize all settings whose meanings have changed in Emacs itself. This includes new user options and faces, and new customization groups, as well as older options and faces whose meanings or default values have changed since the previous major Emacs release.

    With argument SINCE-VERSION (a string), customize all settings that were added or redefined since that version.

  2. The help commands for a variable (including an option) or a function tell you whether it has been deprecated (is obsolete): C-h v and C-h f.

  3. You can M-x rgrep the Emacs Lisp source code for things like define-obsolete-function-alias, define-obsolete-variable-alias, define-obsolete-face-alias, make-obsolete, make-obsolete-variable, and "(declare (obsolete ". Or just grep for obsolete. (There are also some library-specific obsolete declarations, such as semantic-varalias-obsolete, semantic-alias-obsolete, erc-make-obsolete, and ex-cmd-obsolete.)

    That won't find everything, but it is a start. Beyond that, you can use function mapatoms with a function that gets and tests symbol properties like byte-obsolete-variable, byte-obsolete-info, and command-execute-obsolete-warned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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