Making Emacs Work the Way You Think It Should

Emacs not only has per-user customizations; it can also have sitewide customizations. If Emacs isn't doing what you expect it to, you might want to try inhibiting any global customization file by starting Emacs with no customization.

You can do that by using one of these command-line options when you invoke Emacs.

  • --no-init-file, -q load neither ~/.emacs nor default.el

  • --no-site-file do not load site-start.el

If you normally start Emacs from an icon, it's helpful to learn how to start it from the command-line for cases like this. (You may also want to use the -debug option sometime to help you figure out what's wrong with your .emacs file if it is messed up following a change.) Chapter 13 describes how to start Emacs from the command-line for Mac OS X and Windows users.

You can also inhibit global initialization by creating a one-line .emacs file in your home directory. It should look exactly like this:

(setq inhibit-default-init t) ; no global initialization

Start Emacs again. This file prevents Emacs from reading its global initialization file.

There's still one awkward situation: what if you're sitting down at someone else's system? You start Emacs, and all of a sudden you're faced with someone else's "private" key bindings and features. Even in this situation, there's a solution:

  • Try using the command emacs -q. The -q option tells Emacs not to read the user's .emacs file before starting. By doing this, you'll avoid the user's private ...

Get Learning GNU Emacs, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.