2

I don't know what change in my configuration caused this, but scratch buffer always starts in fundamental-mode. I would like to have emacs-lisp-mode in the scratch buffer. I tried to do

(setq initial-major-mode 'emacs-lisp-mode) 

But it didn't help. How can I investigate the cause of this?

5

Check the value of option initial-major-mode: M-x customize-option RET initial-major-mode RET.

Its default value is lisp-interaction-mode, which puts *scratch* in that mode.

C-h v initial-major-mode tells you this:

Major mode command symbol to use for the initial *scratch* buffer.

You can customize this variable.

So remove the customization that changed its value from the default value. In buffer *Customize Option: Initial Major Mode*, click the State button and choose the menu item that reverts the option to its standard value.

You say that you tried just using setq to change the value, presumably in your init file. Using Customize instead, and reverting to the default value, instead of setting and saving the standard value, might help.

Beyond that, it is possible that something in your init file is changing the value of the option later on. To find it, recursively bisect your init file (by commenting out 1/2, then 3/4, 7/8, 15/16,...) until you find the tiny part that causes the problem. If it's not obvious then how to fix it, report what you found here. You can comment out a region of your init file by selecting it and using command comment-region. With C-u the command uncomments the region.

  • The problem even exists when i start emacs with -q option. Very weird! – rumember Jul 18 '15 at 12:26
  • -q is not -Q.See (emacs) Initial Options. Besides your init file, there are site-start.el, the site-lisp directories, and X resources. – Drew Jul 18 '15 at 14:11
  • I got the Problem with -Q option as well. I think i have messed something up in the original sources, because i remember i fiddled around there some long time ago. Thanks for your help! – rumember Jul 18 '15 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.