The GNU Emacs FAQ
This is the GNU Emacs FAQ.
This FAQ is maintained as a part of GNU Emacs. If you find any errors, or have any suggestions, please use M-x report-emacs-bug to report them.
This is the version of the FAQ distributed with Emacs 30.2, and mainly describes that version. Although there is some information on older versions, details about very old releases (now only of historical interest) have been removed. If you are interested in this, consult either the version of the FAQ distributed with older versions of Emacs, or the history of this document in the Emacs source repository.
Since Emacs releases are very stable, we recommend always running the latest release.
This FAQ is not updated very frequently. When you have a question about Emacs, the Emacs manual is often the best starting point.
Copyright © 2001–2025 Free Software Foundation, Inc.
Copyright © 1994–2000 Reuven M. Lerner
Copyright © 1992–1993 Steven Byrnes
Copyright © 1990–1992 Joseph Brian Wells
This list of frequently asked questions about GNU Emacs with answers (“FAQ”) may be translated into other languages, transformed into other formats (e.g., Texinfo, Info, HTML, PDF), and updated with new information.
The same conditions apply to any derivative of the FAQ as apply to the FAQ itself. Every copy of the FAQ must include this notice or an approved translation, information on who is currently maintaining the FAQ and how to contact them (including their e-mail address), and information on where the latest version of the FAQ is archived.
The FAQ may be copied and redistributed under these conditions, except that the FAQ may not be embedded in a larger literary work unless that work itself allows free copying and redistribution.
Table of Contents
- 3.1 I’m just starting Emacs; how do I do basic editing?
- 3.2 How do I find out how to do something in Emacs?
- 3.3 How do I get a printed copy of the Emacs manual?
- 3.4 Where can I get documentation on Emacs Lisp?
- 3.5 How do I install a piece of Texinfo documentation?
- 3.6 How do I print a Texinfo file?
- 3.7 Can I view Info files without using Emacs?
- 3.8 What informational files are available for Emacs?
- 3.9 Where can I get help in installing Emacs?
- 3.10 Where can I get the latest version of this FAQ?
- 4.1 Where does the name “Emacs” come from?
- 4.2 What is the latest version of Emacs?
- 4.3 What is different about Emacs 30?
- 4.4 What is different about Emacs 29?
- 4.5 What is different about Emacs 28?
- 4.6 What is different about Emacs 27?
- 4.7 What is different about Emacs 26?
- 4.8 What is different about Emacs 25?
- 4.9 What is different about Emacs 24?
- 4.10 What is different about Emacs 23?
- 4.11 What is different about Emacs 22?
- 4.12 What is different about Emacs 21?
- 4.13 What is different about Emacs 20?
- 4.14 What was XEmacs?
- 5.1 How do I set up an init file properly?
- 5.2 How do I start using Customize?
- 5.3 How do I get colors and syntax highlighting on a TTY?
- 5.4 How do I debug an init file?
- 5.5 How do I make Emacs display the current line (or column) number?
- 5.6 How can I modify the titlebar to contain the current file name?
- 5.7 How do I turn on abbrevs by default just in mode
mymode? - 5.8 How do I make Emacs use a certain major mode for certain files?
- 5.9 How can I replace highlighted text with what I type?
- 5.10 How do I control Emacs’s case-sensitivity when searching/replacing?
- 5.11 How do I search for, delete, or replace unprintable (eight-bit or control) characters?
- 5.12 How do I input a newline character in isearch or query-replace?
- 5.13 How do I copy text from the kill ring into the search string?
- 5.14 How do I make Emacs wrap words for me?
- 5.15 How do I turn on
auto-fill-modeby default? - 5.16 How do I change
load-path? - 5.17 How do I use an already running Emacs from another window?
- 5.18 How do I make Emacs recognize my compiler’s funny error messages?
- 5.19 How do I change the indentation for
switch? - 5.20 How to customize indentation in C, C
++, and Java buffers? - 5.21 How do I make Emacs “typeover” or “overwrite” instead of inserting?
- 5.22 How do I stop Emacs from beeping on a terminal?
- 5.23 How do I turn down the bell volume in Emacs running under X?
- 5.24 How do I tell Emacs to automatically indent a new line to the indentation of the previous line?
- 5.25 How do I show which parenthesis matches the one I’m looking at?
- 5.26 In C mode, can I show just the lines that will be left after
#ifdefcommands are handled by the compiler? - 5.27 How do I repeat a command as many times as possible?
- 5.28 What are the valid X resource settings (i.e., stuff in .Xdefaults)?
- 5.29 How do I execute (“evaluate”) a piece of Emacs Lisp code?
- 5.30 How do I change Emacs’s idea of the TAB character’s length?
- 5.31 How do I insert <some text> at the beginning of every line?
- 5.32 How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short?
- 5.33 How do I tell Emacs to iconify itself?
- 5.34 How do I use regexps (regular expressions) in Emacs?
- 5.35 How do I perform a replace operation across more than one file?
- 5.36 Where is the documentation for
etags? - 5.37 How do I disable backup files?
- 5.38 How do I disable
auto-save-mode? - 5.39 Making Emacs write all auxiliary files somewhere else
- 5.40 How can I go to a certain line given its number?
- 5.41 How can I create or modify new pull-down menu options?
- 5.42 How do I delete menus and menu options?
- 5.43 How do I turn on syntax highlighting?
- 5.44 How can I force Emacs to scroll only one line when I move past the bottom of the screen?
- 5.45 How can I edit Windows files using Emacs?
- 5.46 How can I tell Emacs to fill paragraphs with a single space after each period?
- 5.47 Why these strange escape sequences from
lsfrom the Shell mode? - 5.48 How can I start Emacs in full screen?
- 5.49 How can I alleviate the limitations of the Linux console?
- 6.1 Does Emacs have problems with large files?
- 6.2 How do I get rid of ‘
^M’ or echoed commands in my shell buffer? - 6.3 Why do I get an error message when I try to run M-x shell?
- 6.4 Where is the termcap/terminfo entry for terminal type ‘
emacs’? - 6.5 Why does Emacs say ‘
Error in init file’? - 6.6 Why does Emacs ignore my X resources (my .Xdefaults file)?
- 6.7 Why don’t my customizations of the frame parameters work?
- 6.8 How do I edit a file with a ‘
$’ in its name? - 6.9 Why does shell mode lose track of the shell’s current directory?
- 6.10 Are there any security risks in Emacs?
- 6.11 Dired says, ‘
no file on this line’ when I try to do something.
- 9.1 How do I bind keys (including function keys) to commands?
- 9.2 Why does Emacs say ‘
Key sequence XXX uses invalid prefix characters’? - 9.3 Why doesn’t this [terminal or window-system setup] code work in my init file, but it works just fine after Emacs starts up?
- 9.4 How do I tell what characters or symbols my function or arrow keys emit?
- 9.5 How do I set the X key “translations” for Emacs?
- 9.6 Why does the Backspace key invoke help?
- 9.7 How do I swap two keys?
- 9.8 How do I produce C-XXX with my keyboard?
- 9.9 What if I don’t have a Meta key?
- 9.10 What if I don’t have an Escape key?
- 9.11 Can I make my Compose Character key behave like a Meta key?
- 9.12 How do I bind a combination of modifier key and function key?
- 9.13 Why doesn’t my Meta key work in an
xtermwindow? - 9.14 Why don’t some keys like C-. work on xterm?
- 11.1 How do I change the included text prefix in mail/news followups?
- 11.2 How do I save a copy of outgoing mail?
- 11.3 Why doesn’t Emacs expand my aliases when sending mail?
- 11.4 How can I sort the messages in my Rmail folder?
- 11.5 Why does Rmail need to write to
/var/spool/mail? - 11.6 How can I force Rmail to reply to the sender of a message, but not the other recipients?
- 11.7 How do I make Emacs automatically start my mail/news reader?
- 11.8 How do I read news under Emacs?
- 11.9 How do I make Gnus faster?
- 11.10 How do I catch up all newsgroups in Gnus?