开发者

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?)


  1. Take a look at the variable inhibit-startup-screen.

    (setq inhibit-startup-screen t)
    
  2. 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 the lambda 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜