This isn't a bug in your code, but in some code provided with Emacs that is called by one of the functions you're calling. It is quite possibly Emacs bug #11357.
Your code is appropriate, except that as sds noted you're overcomplicating things with emacs-startup-hook
. Most things can be done right when your .emacs
is being loaded.
(ido-mode t)
(global-visual-line-mode 1)
(add-hook 'emacs-startup-hook
(lambda ()
(kill-buffer "*scratch*")))
The only reason I can think of to use emacs-startup-hook
the way you did is if you frequently reload your .emacs
and you frequently change ido-mode
or global-visual-line-mode
and don't want them to be reverted when you reload .emacs
.
For alternate ways of getting more out of Emacs than killing *scratch*
, see Automatically closing the scratch buffer and Prevent unwanted buffers from opening.