Even when I invoke emacs -batch (that is, batch mode without actually doing anything), emacs vomits out a whole pile of messages:
$ emacs -batch
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50devhelp.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50psvn.el (source)...
Is there any way to silence these messages? Google hasn’t been too helpful for this.
Those are the messages that would normally show up in the
*Messages*buffer, which are instead going to stderr. Here are a few ways to silence it, in increasing order of sophistication:The simplest fix would be to redirect stderr, if you’re not going to use it:
Those messages are coming from something loaded in the site-wide initialization. If you don’t need any other functionality from your initialization files, you can try:
In theory one can achieve this via
(setq force-load-messages nil), but the fact that the site-file is the one printing here means you likely can’t do it early enough.advise the
loadfunction so that it is always called withNOMESSAGE. Here’s a sketch:This should just force load to always pass
tin theNOMESSAGEargument, and then loads thesite-run-file, ignoring errors if no such file is present. (Note that at least on all 2 of the machines I use emacs on, there’s nosite-run-file; I have no idea how common that is in the wild.)