EMACS(1)
๐ EMACS(1) โ the GNU one, bestie
okay so this is the manual page for emacs โ the GNU project Emacs editor, living in the GNU manual section 1. yes THE emacs. the one your CS professor won't shut up about. buckle up ๐
โจ SYNOPSIS โจ
emacs [ command-line switches ] [ files ... ]
that's it. that's the whole vibe. flags and files. go off ๐
๐ธ DESCRIPTION ๐ธ
GNU Emacs is a version of Emacs, and it was written by the author of the original (PDP-10) Emacs, Richard Stallman. like, the actual guy. the origin story is real.
The user functionality of GNU Emacs encompasses everything other editors do, and it is easily extensible since its editing commands are written in Lisp. everything. literally everything. and if it doesn't do the thing yet, you write a lil Lisp and now it does. slay.
The primary documentation of GNU Emacs is in the GNU Emacs Manual, which you can read using Info, either from Emacs or as a standalone program. Please look there for complete and up-to-date documentation. and ngl, this man page is updated only when someone volunteers to do so โ so like, respect the volunteers, but also maybe don't treat this page as gospel ๐
Emacs has an extensive interactive help facility, but the facility assumes that you know how to manipulate Emacs windows and buffers. (vibe check: you gotta know the window/buffer basics first, bestie, no skipping.)
CTRL-h or F1 enters the Help facility.
- Help Tutorial (
CTRL-h t) โ starts an interactive tutorial to quickly teach beginners the fundamentals of Emacs. this is the one. start here. it's giving "kindest onboarding ever" ๐ซถ - Help Apropos (
CTRL-h a) โ helps you find a command with a name matching a given pattern. - Help Key (
CTRL-h k) โ describes a given key sequence. - Help Function (
CTRL-h f) โ describes a given Lisp function.
GNU Emacs's many special packages handle mail reading (RMail) and sending (Mail), outline editing (Outline), compiling (Compile), running subshells within Emacs windows (Shell), running a Lisp read-eval-print loop (Lisp-Interaction-Mode), automated psychotherapy (Doctor), and much more. yes. automated psychotherapy. we don't ask. we just accept. iconic behavior honestly ๐
๐ฆ Emacs Options ๐ฆ
The following options are of general interest:
fileโ Edit file. just yeet a filename at it and go.--file=file,--find-file=file,--visit=fileโ The same as specifying file directly as an argument. three whole names for one behavior, because why not ๐+numberโ Go to the line specified by number. โ ๏ธ do not insert a space between the+sign and the number. This applies only to the next file specified. (so+42 thing.c, not+ 42 thing.c. the space is a crime.)+line:columnโ Go to the specified line and column. fancy. precise. love that for you.--chdir=directoryโ Change to directory.-q,--no-init-fileโ Do not load an init file.-nl,--no-shared-memoryโ Do not use shared memory.--no-site-fileโ Do not load the site-wide startup file.-nsl,--no-site-lispโ Do not add site-lisp directories toload-path.--no-desktopโ Do not load a saved desktop.-Q,--quickโ Similar to-q --no-site-file --no-splash. Also, avoid processing X resources. the "just let me in, clean, no baggage" mode โจ--no-splashโ Do not display a splash screen during start-up.--debug-initโ Enable Emacs Lisp debugger during the processing of the user init file~/.emacs. This is useful for debugging problems in the init file. your init file is broken again isn't it. it's okay. turn this on ๐ญ-uuser,--user=userโ Load user's init file instead of your own.--init-directory=directoryโ Start emacs withuser-emacs-directoryset to directory.-tfile,--terminal=fileโ Use specified file as the terminal instead of using stdin/stdout. ๐จ This must be the first argument specified in the command line. first. literally first. don't test it.--daemon[=name],--bg-daemon[=name]โ Start Emacs as a daemon, enabling the Emacs server and disconnecting from the terminal. You can then use theemacsclient(seeemacsclient(1)) command to connect to the server (with optional name). background mode: main character energy, zero terminal attached ๐ฅ--fg-daemon[=name]โ Like--bg-daemon, but don't disconnect from the terminal. same energy, but it stays and holds your hand.--versionโ Display Emacs version information and exit.--helpโ Display help and exit.
The following options are Lisp-oriented (these options are processed in the order encountered) โ order matters bestie, they get run top to bottom:
-ffunction,--funcall=functionโ Execute the lisp function.-lfile,--load=fileโ Load the lisp code in the file.--eval=expr,--execute=exprโ Evaluate the Lisp expression expr.
The following options are useful when running Emacs as a batch editor:
--batchโ Edit in batch mode. The editor will send messages tostderr. You must use-land-foptions to specify files to execute and functions to call. no GUI, no vibes, just work ๐--scriptfile โ Run file as an Emacs Lisp script.--insert=fileโ Insert contents of file into the current buffer.--killโ Exit Emacs while in batch mode.-Ldir,--directory=dirโ Add dir to the list of directories Emacs searches for Lisp files.
๐ Using Emacs with X ๐
Emacs has been tailored to work well with the X Window System. If you run Emacs from under X windows, it will create its own X window to display in. You will probably want to start the editor as a background process so that you can continue using your original window. (pro tip energy: background it, keep your life, keep your terminal ๐ซถ)
Emacs can be started with the following X switches:
--name=nameโ Specify the name which should be assigned to the initial Emacs window. This controls looking up X resources as well as the window title.--no-x-resourcesโ Do not load X resources.-Tname,--title=nameโ Specify the title for the initial X window.-r,-rv,--reverse-videoโ Display the Emacs window in reverse video.-fnfont,--font=fontโ Set the Emacs window's font to that specified by font. You will find the various X fonts in the/usr/lib/X11/fontsdirectory. Note that Emacs will only accept fixed width fonts. Under the X11 Release 4 font-naming conventions, any font with the value"m"or"c"in the eleventh field of the font name is a fixed width font. Furthermore, fonts whose name are of the form widthxheight are generally fixed width, as is the fontfixed. Seexlsfonts(1)for more information.
When you specify a font, be sure to put a space between the switch and the font name. yes. the space. it's load-bearing โ
--xrm=resourcesโ Set additional X resources.--color,--color=modeโ Override color mode for character terminals; mode defaults to"auto", and can also be"never","auto","always", or a mode name like"ansi8".-bwpixels,--border-width=pixelsโ Set the Emacs window's border width to the number of pixels specified by pixels. Defaults to one pixel on each side of the window.-ibpixels,--internal-border=pixelsโ Set the window's internal border width to the number of pixels specified by pixels. Defaults to one pixel of padding on each side of the window.-ggeometry,--geometry=geometryโ Set the Emacs window's width, height, and position as specified. The geometry specification is in the standard X format; seeX(7)for more information. The width and height are specified in characters; the default for GUI frames is a width of80and a height between35and40, depending on the OS and the window manager. See the Emacs manual, section "Options for Window Size and Position", for information on how window sizes interact with selecting or deselecting the tool bar, tab bar and menu bar.-lsppixels,--line-spacing=pixelsโ Additional space to put between lines.-vb,--vertical-scroll-barsโ Enable vertical scrollbars.-fh,--fullheightโ Make the first frame as high as the screen.-fs,--fullscreenโ Make the first frame fullscreen.-fw,--fullwidthโ Make the first frame as wide as the screen.-mm,--maximizedโ Maximize the first frame, like-fw -fh. big. huge. taking up space. we love that ๐-fgcolor,--foreground-color=colorโ On color displays, set the color of the text.
Use the command M-x list-colors-display for a list of valid color names.
-bgcolor,--background-color=colorโ On color displays, set the color of the window's background.-bdcolor,--border-color=colorโ On color displays, set the color of the window's border.-crcolor,--cursor-color=colorโ On color displays, set the color of the window's text cursor.-mscolor,--mouse-color=colorโ On color displays, set the color of the window's mouse cursor.-ddisplayname,--display=displaynameโ Create the Emacs window on the display specified by displayname. ๐จ Must be the first option specified in the command line. first option. no negotiations. ๐ค-nbi,--no-bitmap-iconโ Do not use picture of gnu for Emacs icon. (but... the gnu... ๐ฅบ)--iconicโ Start Emacs in iconified state.-nbc,--no-blinking-cursorโ Disable blinking cursor.--parent-id=xidโ Set parent window.-nw,--no-window-systemโ Tell Emacs not to create a graphical frame. If you use this switch when invoking Emacs from anxterm(1)window, display is done in that window.-D,--basic-displayโ This option disables many display features; use it for debugging Emacs.
๐ X default values, but make it .Xresources ๐
You can set X default values for your Emacs windows in your .Xresources file (see xrdb(1)). Use the following format:
emacs.keyword:value
where value specifies the default value of keyword. Emacs lets you set default values for the following keywords:
background(classBackground) โ For color displays, sets the window's background color.bitmapIcon(classBitmapIcon) โ IfbitmapIcon's value is set toon, the window will iconify into the"kitchen sink."๐ฝ๏ธ yes really. the kitchen sink. no notes.borderColor(classBorderColor) โ For color displays, sets the color of the window's border.borderWidth(classBorderWidth) โ Sets the window's border width in pixels.cursorColor(classForeground) โ bestie, this sets the color of the window's text cursor on color displays. That's it. That's the whole vibe.cursorBlink(classCursorBlink) โ do you want the cursor to blink, or not? The default is on. Useofforfalseto kill the blinking, no cap.font(classFont) โ sets the window's text font. Your whole aesthetic, basically.foreground(classForeground) โ for color displays, sets the window's text color.fullscreen(classFullscreen) โ the desired fullscreen size. Value can be one offullboth,maximized,fullwidth, orfullheightโ which line up with the command-line options-fs,-mm,-fw, and-fh, respectively. Heads up though: this applies to the initial frame only. Note it.geometry(classGeometry) โ sets the geometry of the Emacs window, as described above (scroll up bestie).iconName(classTitle) โ sets the icon name for the Emacs window icon. Tiny detail, big energy.internalBorder(classBorderWidth) โ sets the window's internal border width, in pixels.lineSpacing(classLineSpacing) โ additional space ("leading") between lines, in pixels. Breathing room for your text, literally.menuBar(classMenuBar) โ gives frames menu bars ifon; no menu bars ifoff. And if you do have one and wanna control how it looks, the Emacs manual sections "Lucid Resources" and "Motif Resources" have you covered.minibuffer(classMinibuffer) โ ifnone, don't make a minibuffer in this frame. It'll use a separate minibuffer frame instead. Fancy.paneFont(classFont) โ font name for menu pane titles, in non-toolkit versions of Emacs.pointerColor(classForeground) โ for color displays, sets the color of the window's mouse cursor. Yes, you can make your pointer cute.privateColormap(classPrivateColormap) โ ifon, use a private color map โ in the case where the "default visual" of class PseudoColor and Emacs is using it.reverseVideo(classReverseVideo) โ ifreverseVideo's value is set toon, the window will be displayed in reverse video.screenGamma(classScreenGamma) โ gamma correction for colors, equivalent to the frame parameterscreen-gamma.scrollBarWidth(classScrollBarWidth) โ the scroll bar width in pixels, equivalent to the frame parameterscroll-bar-width.selectionFont(classSelectionFont) โ font name for pop-up menu items, in non-toolkit versions of Emacs. (For toolkit versions, go read the Emacs manual, sections "Lucid Resources" and "Motif Resources".)selectionTimeout(classSelectionTimeout) โ number of milliseconds to wait for a selection reply. A value of0means wait as long as necessary. Patient queen behavior.synchronous(classSynchronous) โ run Emacs in synchronous mode ifon. Synchronous mode is lowkey useful for debugging X problems.title(classTitle) โ sets the title of the Emacs window. Your name in lights, iconically.toolBar(classToolBar) โ number of lines to reserve for the tool bar.tabBar(classTabBar) โ number of lines to reserve for the tab bar.useXIM(classUseXIM) โ turns off use of X input methods (XIM) iffalseoroff.verticalScrollBars(classScrollBars) โ gives frames scroll bars ifon; suppresses scroll bars ifoff.visualClass(classVisualClass) โ specify the "visual" that X should use. This tells X how to handle colors. The value should start with one ofTrueColor,PseudoColor,DirectColor,StaticColor,GrayScale, andStaticGray, followed by-depth, where depth is the number of color planes.
๐ MANUALS ๐
okay so you can literally order printed copies of the GNU Emacs Manual from the Free Software Foundation, which develops GNU software. See the online store at <https://shop.fsf.org/>. Physical Emacs. On paper. Iconic.
Your local administrator might also have copies available โ ask around, bestie. And as with all software and publications from FSF, everyone is permitted to make and distribute copies of the Emacs manual. Slay. The Texinfo source to the manual is also included in the Emacs source distribution.
๐๏ธ FILES ๐๏ธ
/usr/local/share/infoโ files for the Info documentation browser. The complete text of the Emacs reference manual is included in a convenient tree structured form. This includes the Emacs Lisp Reference Manual (useful to literally anyone wishing to write programs in the Emacs Lisp extension language) and the Introduction to Programming in Emacs Lisp. Chef's kiss./usr/local/share/emacs/$VERSION/lispโ Lisp source files and compiled files that define most editing commands. Some are preloaded; others are autoloaded from this directory when used./usr/local/libexec/emacs/$VERSION/$ARCHโ various programs that are used with GNU Emacs./usr/local/share/emacs/$VERSION/etcโ various files of information./usr/local/share/emacs/$VERSION/etc/DOC.*โ contains the documentation strings for the Lisp primitives and preloaded Lisp functions of GNU Emacs. They're stored here to reduce the size of Emacs proper. Efficient king.
๐ BUGS ๐
There's a mailing list, bug-gnu-emacs@gnu.org, for reporting Emacs bugs and fixes. But before you come in swinging and report something as a bug, please try to be sure that it really is a bug โ not a misunderstanding or a deliberate feature. (Yes, that weird thing might be intentional. Deep breaths.)
We ask you to read the section "Reporting Bugs" in the Emacs manual for hints on how and when to report bugs. Also, include the version number of the Emacs you are running in every bug report that you send in. Fr fr, don't skip this.
Bugs tend actually to be fixed if they can be isolated, so it is in your interest to report them in such a way that they can be easily reproduced. Help them help you, bestie.
Do not expect a personal answer to a bug report. The purpose of reporting bugs is to get them fixed for everyone in the next release, if possible. For personal assistance, consult the service directory at <https://www.fsf.org/resources/service/> for a list of people who offer it.
Please do not send anything but bug reports to this mailing list. For other Emacs lists, see <https://savannah.gnu.org/mail/?group=emacs>. Keep the group chat on topic ๐
๐ UNRESTRICTIONS ๐
Emacs is free; anyone may redistribute copies of Emacs to anyone under the terms stated in the GNU General Public License, a copy of which accompanies each copy of Emacs and which also appears in the reference manual.
Copies of Emacs may sometimes be received packaged with distributions of Unix systems, but it is never included in the scope of any license covering those systems. Such inclusion violates the terms on which distribution is permitted. In fact, the primary purpose of the GNU General Public License is to prohibit anyone from attaching any other restrictions to redistribution of Emacs. Read that again. That's the whole point.
Richard Stallman encourages you to improve and extend Emacs, and urges that you contribute your extensions to the GNU library. Eventually GNU (Gnu's Not Unix) will be a complete replacement for Unix. Everyone will be free to use, copy, study and change the GNU system. The vision is immaculate.
๐ SEE ALSO ๐
๐ AUTHORS ๐
Emacs was written by Richard Stallman and the Free Software Foundation. For detailed credits and acknowledgments, see the GNU Emacs manual.
๐ COPYING ๐
Copyright 1995โ2026 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this document into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.
There is NO WARRANTY, to the extent permitted by law. No cap, no warranty, that's the deal.
okay and that's the whole page bestie ๐ซถ this is GNU Emacs version 31.1, dated 2024-07-18, and it's an EMACS(1) page โ go forth and edit, you absolute main character ๐โจ
๐ฆ where this page comes from
- arch rolling: emacs 31.1-2 ยท GPL-3.0-or-later
- arch rolling: emacs-nox 31.1-2 ยท GPL-3.0-or-later
- arch rolling: emacs-wayland 31.1-2 ยท GPL-3.0-or-later
- nixpkgs unstable: emacs 31.1
- nixpkgs unstable: emacs-gtk3 31.1
- nixpkgs unstable: emacs-nox 31.1
- nixpkgs unstable: emacs-pgtk 31.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms