10
votes

Ever since I installed emacs24 some tiny insignificant piece of my configuration files stopped working. Since I don't really care about this error and It does not affect me I just want Emacs to shut up about initialization warnings and just open the scratch buffer (as it is it opens a second buffer with some error stuff).

Is there a way to do this without having to sit hours to debug lisp code I don't understand?

I really can't post the configuration file because it's really really big and messy, but this is the warning I get:

Warning (initialization): An error occurred while loading `/home/sofia/.emacs':

Symbol's function definition is void: plist-to-alist

To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace.

In a nutshell, I don't want to ensure normal operation, I just want one buffer when opening emacs

1
This won't directly answer your question, but I think this other answer explains how to fix the error instead of ignoring it.Carl Groner
+1 to fixing or removing the error instead of ignoring or masking it. A good programmer should take pride in their tools. The highest level of the backtrace should point you right to the offending line in your .emacs - then if you don't want to invest in a fix you can remove the containing sexp.rhashimoto
Thanks, that fixed this particular problem, but in general, yes, that's not the answer. I want to get rid of those warnings, It happens often and I really don't want to sit and fix elisp code every time it happens.Sofia Bravo
You can never guarantee that your existing config will be 100% compatible with a new release of Emacs, so if you're not in a position to resolve problems with your config, then upgrading Emacs becomes risky. I would strongly recommend that you revert back to the version of Emacs in which your config worked, rather than running with a broken configuration. Postpone the upgrade until you have the time to fix the problems.phils
Nobody has mentioned the obvious -- i.e., search your source files for the term plist-to-alist and you will see exactly where the problem is -- a library containing that function definition has not been loaded, or the function no longer exists. The link above by Carl Groner also offers a solution to create the missing function yourself.lawlist

1 Answers

17
votes

I'm not saying that it's a good idea to do this (in fact I very much agree with @Carl Groner and @rashimoto that masking errors instead of fixing them is usually a Bad Idea™), but at your own risk try adding the following to the top of your .emacs file:

(setq warning-minimum-level :emergency)

This tells Emacs not to warn you about anything except problems

that will seriously impair Emacs operation soon if you do not attend to [them] promptly.

By contrast, the default value of warning-minimum-level is :warning, which causes Emacs to warn you about

data or circumstances that are not inherently wrong, but raise suspicion of a possible problem.

More info about warnings and options for dealing with them here and here.