Invalid function warning in Emacs
I wanted to get rid of that automatic "splash screen" that Emacs vi开发者_C百科sits (called GNU Emacs). I added the following line to my .emacs file:
(add-hook 'after-init-hook '(kill-buffer "GNU Emacs"))
Well, it works, but I get the following warning message in the echo area:
"Invalid function: (kill-buffer "GNU Emacs")
I don't see what's invalid. Anyone know?
Thanks, P.S. I'm sure a better approach would be to get Emacs to just not visit the GNU Emacs in the first place, but I haven't figured out how to do that (maybe something in the default.el file?)
Take a look at the variable
inhibit-startup-screen
.(setq inhibit-startup-screen t)
The function
add-hook
expects a function as its second argument;'(kill-buffer ...)
evaluates to a list, which is not a function. One way to turn it into a function is to use thelambda
operator:(add-hook 'after-init-hook (lambda () (kill-buffer "GNU Emacs")))
(setq inhibit-default-init 1)
is one way to do it. Didn't it work for you?
精彩评论