Opening emacs without a zero buffer when opening a file

I changed the setting in Emacs. Now, when I try to open the file from the command line, it opens the *scratch* buffer on top of the file. Is there any way to get rid of this? Or a way to reset emacs startup settings?

+6
emacs
source share
5 answers
 Mx customize-group initialization 

Then, when choosing the starting buffer, you can choose one of the following options:

  • Launch screen
  • Catalog
  • File
  • buffer with buffer

Finally, click Save for future sessions.

You can also turn it on / off. See if that helps.

(Another thing that you probably want to do is open only one buffer at startup. I cannot remember how to do this. I will post an update if I find out about this).

+4
source share

You can reload the .emacs file with Mx load-file ~ / .emacs . There are other ways to do this, check out the question How do I upload changes to my .emacs without restarting Emacs? .

If you think that the problem is with your .emacs file, try opening it with the -q option:

 emacs -q somefile 

If this works as you expected, you probably have a bug in your .emacs, and a good way to debug your .emacs is to use the --debug-init option:

 emacs --debug-init 

What Emacs will tell is to provide a stack trace of any error it encounters while loading your .emacs, something like:

 Debugger entered--Lisp error: (wrong-type-argument symbolp (car n)) (setq (car n) 3) (let ((n ...)) (setq (car n) 3)) eval-buffer(#<buffer *load*<2>> nil "/home/tjackson/.emacs.tjackson.el" nil t) ; Reading at buffer position 161460 load-with-code-conversion("/home/tjackson/.emacs.tjackson.el" "/home/tjackson/.emacs.tjackson.el" nil nil) load("/home/tjackson/.emacs.tjackson.el") (let ((debug-on-error t)) (load user-init-file)) (if init-file-debug (let (...) (load user-init-file)) (error (format "Problems while loading the file %s: %s" user-init-file ...))) (condition-case err (load user-init-file) (error (if init-file-debug ... ...))) (if (file-exists-p user-init-file) (condition-case err (load user-init-file) (error ...))) eval-buffer(#<buffer *load*> nil "/home/tjackson/.emacs" nil t) ; Reading at buffer position 12150 load-with-code-conversion("/home/tjackson/.emacs" "/home/tjackson/.emacs" tt) load("~/.emacs" tt) #[nil "....."] command-line() normal-top-level() 

And this generally may indicate what may be wrong. In my case above, I am using setq incorrectly and it looks like inside the let statement, which is inside the /home/tjackson/.emacs.tjackson.el file. A quick search in this file leads me to an error, and I can fix it.

+3
source share

If you want to install reset emacs, you can rename the current .emacs file to another location to have a backup, and then restart Emacs.

+1
source share

My ~/.emacs.d owned by root with limited rights r/w/x , so I could not get access to any user without root authority.

Make sure your current user has read privileges for emacs configuration files / directories.

This is fixed for me:

 sudo chown -R user:group ~/.emacs.d/ 

-R works recursively in a directory.

+1
source share

I deleted the ~/.emacs.d and fixed the situation for me.

0
source share

All Articles