Search code examples
emacswarnings

Emacs: How do I disable "deprecated" warnings


Lately, I started to see ". . . deprecated" warnings at startup.

How do I disable only this type of warning?

As I understand, they come from third-party packages I load from within .emacs.d/init.el. Because these warnings are for the authors of the packages, they aren't useful to me.

There is a past Q&A that discusses how to disable all warnings in general: How do I disable warnings at initialization in Emacs? But I don't want to do that, not to miss my own mistakes in my init.el.

Edit: Here is an example of the warning messages I see:

⛔ Warning (emacs): ‘:events-buffer-scrollback-size’ deprecated. Use ‘events-buffer-config’.

But, these messages change from time to time. My guess is this: The emacs developers decide that some functions and variables are deprecated and switch on the warning. These warnings are signals to the package developers in order to encourage them to replace the deprecated functions or variables.

But the warnings aren't useful to mere users. These warnings started many months ago. Initially I expected that the package developers would quickly fix their codes and the warnings would go away soon. But that's not been the case.

So, it would be nice if you can disable only those warnings which result from the use of deprecated functions or variables, or if there is a "debug mode" switch or something like that, in such a way that the "deprecated" warnings are visible only in the debug mode.


Solution

  • [This answer is credited to @Rorschach . See her/his comments to the original post. I just copy her/his words here to complete this Q&A thread.]

    To suppress this type of warnings only, add '(emacs) to warning-suppress-types or warning-suppress-log-types to your init.el. For example,

    (add-to-list 'warning-suppress-types '(emacs))
    

    I confirm that this has suppressed the warning popup windows I've been seeing.

    It seems that emacs warning has subtypes. I've tried to locate documentation that describes the existing subtypes but failed so far.