{
    "mode": "man",
    "parameter": "Emacs",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/Emacs/1/json",
    "generated": "2026-10-22T13:04:42Z",
    "synopsis": "emacs [ command-line switches ] [ files ... ]",
    "sections": {
        "NAME": {
            "content": "emacs - GNU project Emacs editor\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "emacs [ command-line switches ] [ files ... ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "GNU  Emacs  is  a  version  of  Emacs,  written by the author of the original (PDP-10) Emacs,\nRichard Stallman.  The user functionality of GNU Emacs encompasses everything  other  editors\ndo, and it is easily extensible since its editing commands are written in Lisp.\n\nThe  primary  documentation of GNU Emacs is in the GNU Emacs Manual, which you can read using\nInfo, either from Emacs or as a standalone program.  Please look there for complete  and  up-\nto-date documentation.  This man page is updated only when someone volunteers to do so.\n\nEmacs  has an extensive interactive help facility, but the facility assumes that you know how\nto manipulate Emacs windows and buffers.  CTRL-h or F1 enters the Help facility.  Help Tutor‐\nial (CTRL-h t) starts an interactive tutorial to quickly teach beginners the fundamentals  of\nEmacs.   Help  Apropos  (CTRL-h a) helps you find a command with a name matching a given pat‐\ntern, Help Key (CTRL-h k) describes a given key sequence, and Help Function  (CTRL-h  f)  de‐\nscribes a given Lisp function.\n\nGNU  Emacs's  many  special  packages handle mail reading (RMail) and sending (Mail), outline\nediting (Outline), compiling (Compile), running subshells within Emacs windows (Shell),  run‐\nning  a  Lisp read-eval-print loop (Lisp-Interaction-Mode), automated psychotherapy (Doctor),\nand much more.\n",
            "subsections": [
                {
                    "name": "Emacs Options",
                    "content": "The following options are of general interest:\n\nfile    Edit file.\n\n--file=file, --find-file=file, --visit=file\nThe same as specifying file directly as an argument.\n\n+number Go to the line specified by number (do not insert a space between the \"+\" sign\nand the number).  This applies only to the next file specified.\n\n+line:column\nGo to the specified line and column.\n\n--chdir=directory\nChange to directory.\n\n-q, --no-init-file\nDo not load an init file.\n\n-nl, --no-shared-memory\nDo not use shared memory.\n\n--no-site-file\nDo not load the site-wide startup file.\n\n-nsl, --no-site-lisp\nDo not add site-lisp directories to load-path.\n\n--no-desktop\nDo not load a saved desktop.\n\n-Q, --quick\nSimilar to \"-q --no-site-file --no-splash\".   Also,  avoid  processing  X  re‐\nsources.\n\n--no-splash\nDo not display a splash screen during start-up.\n\n--debug-init\nEnable  Emacs  Lisp  debugger  during  the  processing  of  the user init file\n~/.emacs.  This is useful for debugging problems in the init file.\n\n-u user, --user=user\nLoad user's init file.\n\n--init-directory=directory\nStart emacs with user-emacs-directory set to directory.\n\n-t file, --terminal=file\nUse specified file as the terminal instead of using stdin/stdout.   This  must\nbe the first argument specified in the command line.\n\n--daemon[=name], --bg-daemon[=name]\nStart  Emacs as a daemon, enabling the Emacs server and disconnecting from the\nterminal.  You can then use the emacsclient (see  emacsclient(1))  command  to\nconnect to the server (with optional name).\n\n--fg-daemon[=name]\nLike \"--bg-daemon\", but don't disconnect from the terminal.\n\n--version\nDisplay Emacs version information and exit.\n\n--help  Display this help and exit.\n\nThe  following  options  are  Lisp-oriented (these options are processed in the order encoun‐\ntered):\n\n-f function, --funcall=function\nExecute the lisp function function.\n\n-l file, --load=file\nLoad the lisp code in the file file.\n\n--eval=expr, --execute=expr\nEvaluate the Lisp expression expr.\n\nThe following options are useful when running Emacs as a batch editor:\n\n--batch Edit in batch mode.  The editor will send messages to stderr.  You must use -l\nand -f options to specify files to execute and functions to call.\n\n--script file\nRun file as an Emacs Lisp script.\n\n--insert=file\nInsert contents of file into the current buffer.\n\n--kill  Exit Emacs while in batch mode.\n\n-L dir, --directory=dir\nAdd dir to the list of directories Emacs searches for Lisp files.\n"
                },
                {
                    "name": "Using Emacs with X",
                    "content": "Emacs has been tailored to work well with the X Window System.  If you run Emacs from under X\nwindows, it will create its own X window to display in.  You will probably want to start  the\neditor as a background process so that you can continue using your original window.\n\nEmacs can be started with the following X switches:\n\n--name=name\nSpecify  the  name which should be assigned to the initial Emacs window.  This\ncontrols looking up X resources as well as the window title.\n\n--no-x-resources\nDo not load X resources.\n\n-T name, --title=name\nSpecify the title for the initial X window.\n\n-r, -rv, --reverse-video\nDisplay the Emacs window in reverse video.\n\n-fn font, --font=font\nSet the Emacs window's font to that specified by font.  You will find the var‐\nious X fonts in the /usr/lib/X11/fonts directory.  Note that Emacs  will  only\naccept  fixed  width  fonts.  Under the X11 Release 4 font-naming conventions,\nany font with the value \"m\" or \"c\" in the eleventh field of the font name is a\nfixed width font.  Furthermore, fonts whose name are of the form  widthxheight\nare generally fixed width, as is the font fixed.  See xlsfonts(1) for more in‐\nformation.\n\nWhen  you  specify  a  font, be sure to put a space between the switch and the\nfont name.\n\n--xrm=resources\nSet additional X resources.\n\n--color, --color=mode\nOverride color mode for character terminals; mode defaults to \"auto\", and  can\nalso be \"never\", \"auto\", \"always\", or a mode name like \"ansi8\".\n\n-bw pixels, --border-width=pixels\nSet  the Emacs window's border width to the number of pixels specified by pix‐\nels.  Defaults to one pixel on each side of the window.\n\n-ib pixels, --internal-border=pixels\nSet the window's internal border width to the number of  pixels  specified  by\npixels.  Defaults to one pixel of padding on each side of the window.\n\n-g geometry, --geometry=geometry\nSet the Emacs window's width, height, and position as specified.  The geometry\nspecification is in the standard X format; see X(7) for more information.  The\nwidth  and height are specified in characters; the default for GUI frames is a\nwidth of 80 and a height between 35 and 40, depending on the OS and the window\nmanager.  See the Emacs manual, section \"Options for  Window  Size  and  Posi‐\ntion\",  for  information  on how window sizes interact with selecting or dese‐\nlecting the tool bar, tab bar and menu bar.\n\n-lsp pixels, --line-spacing=pixels\nAdditional space to put between lines.\n\n-vb, --vertical-scroll-bars\nEnable vertical scrollbars.\n\n-fh, --fullheight\nMake the first frame as high as the screen.\n\n-fs, --fullscreen\nMake the first frame fullscreen.\n\n-fw, --fullwidth\nMake the first frame as wide as the screen.\n\n-mm, --maximized\nMaximize the first frame, like \"-fw -fh\".\n\n-fg color, --foreground-color=color\nOn color displays, set the color of the text.\n\nUse the command M-x list-colors-display for a list of valid color names.\n\n-bg color, --background-color=color\nOn color displays, set the color of the window's background.\n\n-bd color, --border-color=color\nOn color displays, set the color of the window's border.\n\n-cr color, --cursor-color=color\nOn color displays, set the color of the window's text cursor.\n\n-ms color, --mouse-color=color\nOn color displays, set the color of the window's mouse cursor.\n\n-d displayname, --display=displayname\nCreate the Emacs window on the display specified by displayname.  Must be  the\nfirst option specified in the command line.\n\n-nbi, --no-bitmap-icon\nDo not use picture of gnu for Emacs icon.\n\n--iconic\nStart Emacs in iconified state.\n\n-nbc, --no-blinking-cursor\nDisable blinking cursor.\n\n--parent-id=xid\nSet parent window.\n\n-nw, --no-window-system\nTell  Emacs  not to create a graphical frame.  If you use this switch when in‐\nvoking Emacs from an xterm(1) window, display is done in that window.\n\n-D, --basic-display\nThis option disables many display features; use it for debugging Emacs.\n\nYou can set X default values for your Emacs windows in your .Xresources file  (see  xrdb(1)).\nUse the following format:\n\nemacs.keyword:value\n\nwhere  value  specifies  the default value of keyword.  Emacs lets you set default values for\nthe following keywords:\n\nbackground (class Background)\nFor color displays, sets the window's background color.\n\nbitmapIcon (class BitmapIcon)\nIf bitmapIcon's value is set to on, the window will iconify into the  \"kitchen\nsink.\"\n\nborderColor (class BorderColor)\nFor color displays, sets the color of the window's border.\n\nborderWidth (class BorderWidth)\nSets the window's border width in pixels.\n\ncursorColor (class Foreground)\nFor color displays, sets the color of the window's text cursor.\n\ncursorBlink (class CursorBlink)\nSpecifies  whether  to  make the cursor blink.  The default is on.  Use off or\nfalse to turn cursor blinking off.\n\nfont (class Font)\nSets the window's text font.\n\nforeground (class Foreground)\nFor color displays, sets the window's text color.\n\nfullscreen (class Fullscreen)\nThe desired fullscreen size.  The value can be  one  of  fullboth,  maximized,\nfullwidth,  or fullheight, which correspond to the command-line options \"-fs\",\n\"-mm\", \"-fw\", and \"-fh\", respectively.  Note that this applies to the  initial\nframe only.\n\ngeometry (class Geometry)\nSets the geometry of the Emacs window (as described above).\n\niconName (class Title)\nSets the icon name for the Emacs window icon.\n\ninternalBorder (class BorderWidth)\nSets the window's internal border width in pixels.\n\nlineSpacing (class LineSpacing)\nAdditional space (\"leading\") between lines, in pixels.\n\nmenuBar (class MenuBar)\nGives frames menu bars if on; don't have menu bars if off.  See the Emacs man‐\nual,  sections \"Lucid Resources\" and \"Motif Resources\", for how to control the\nappearance of the menu bar if you have one.\n\nminibuffer (class Minibuffer)\nIf none, don't make a minibuffer in  this  frame.   It  will  use  a  separate\nminibuffer frame instead.\n\npaneFont (class Font)\nFont name for menu pane titles, in non-toolkit versions of Emacs.\n\npointerColor (class Foreground)\nFor color displays, sets the color of the window's mouse cursor.\n\nprivateColormap (class PrivateColormap)\nIf  on,  use  a  private  color map, in the case where the \"default visual\" of\nclass PseudoColor and Emacs is using it.\n\nreverseVideo (class ReverseVideo)\nIf reverseVideo's value is set to on, the window will be displayed in  reverse\nvideo.\n\nscreenGamma (class ScreenGamma)\nGamma correction for colors, equivalent to the frame parameter \"screen-gamma\".\n\nscrollBarWidth (class ScrollBarWidth)\nThe   scroll   bar   width  in  pixels,  equivalent  to  the  frame  parameter\n\"scroll-bar-width\".\n\nselectionFont (class SelectionFont)\nFont name for pop-up menu items,  in  non-toolkit  versions  of  Emacs.   (For\ntoolkit  versions, see the Emacs manual, sections \"Lucid Resources\" and \"Motif\nResources\".)\n\nselectionTimeout (class SelectionTimeout)\nNumber of milliseconds to wait for a selection reply.  A value of 0 means wait\nas long as necessary.\n\nsynchronous (class Synchronous)\nRun Emacs in synchronous mode if on.  Synchronous mode is useful for debugging\nX problems.\n\ntitle (class Title)\nSets the title of the Emacs window.\n\ntoolBar (class ToolBar)\nNumber of lines to reserve for the tool bar.\n\ntabBar (class TabBar)\nNumber of lines to reserve for the tab bar.\n\nuseXIM (class UseXIM)\nTurns off use of X input methods (XIM) if false or off.\n\nverticalScrollBars (class ScrollBars)\nGives frames scroll bars if on; suppresses scroll bars if off.\n\nvisualClass (class VisualClass)\nSpecify the \"visual\" that X should use.  This tells X how  to  handle  colors.\nThe  value should start with one of TrueColor, PseudoColor, DirectColor, Stat‐\nicColor, GrayScale, and StaticGray, followed by -depth,  where  depth  is  the\nnumber of color planes.\n"
                }
            ]
        },
        "MANUALS": {
            "content": "You can order printed copies of the GNU Emacs Manual from the Free Software Foundation, which\ndevelops GNU software.  See the online store at <https://shop.fsf.org/>.\nYour local administrator might also have copies available.  As with all software and publica‐\ntions from FSF, everyone is permitted to make and distribute copies of the Emacs manual.  The\nTexinfo source to the manual is also included in the Emacs source distribution.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/usr/local/share/info  —  files for the Info documentation browser.  The complete text of the\nEmacs reference manual is included in a convenient tree structured form.  This  includes  the\nEmacs Lisp Reference Manual, useful to anyone wishing to write programs in the Emacs Lisp ex‐\ntension language, and the Introduction to Programming in Emacs Lisp.\n\n/usr/local/share/emacs/$VERSION/lisp  — Lisp source files and compiled files that define most\nediting commands.  Some are preloaded; others are autoloaded from this directory when used.\n\n/usr/local/libexec/emacs/$VERSION/$ARCH — various programs that are used with GNU Emacs.\n\n/usr/local/share/emacs/$VERSION/etc — various files of information.\n\n/usr/local/share/emacs/$VERSION/etc/DOC.* — contains the documentation strings for  the  Lisp\nprimitives  and  preloaded  Lisp  functions of GNU Emacs.  They are stored here to reduce the\nsize of Emacs proper.\n\n",
            "subsections": []
        },
        "BUGS": {
            "content": "There is a mailing list, bug-gnu-emacs@gnu.org, for reporting Emacs bugs and fixes.  But  be‐\nfore  reporting something as a bug, please try to be sure that it really is a bug, not a mis‐\nunderstanding or a deliberate feature.  We ask you to read the section  \"Reporting  Bugs\"  in\nthe  Emacs manual for hints on how and when to report bugs.  Also, include the version number\nof the Emacs you are running in every bug report that you send in.  Bugs tend actually to  be\nfixed  if  they  can be isolated, so it is in your interest to report them in such a way that\nthey can be easily reproduced.\n\nDo not expect a personal answer to a bug report.  The purpose of reporting  bugs  is  to  get\nthem  fixed  for everyone in the next release, if possible.  For personal assistance, consult\nthe service directory at <https://www.fsf.org/resources/service/> for a list  of  people  who\noffer it.\n\nPlease do not send anything but bug reports to this mailing list.  For other Emacs lists, see\n<https://savannah.gnu.org/mail/?group=emacs>.\n",
            "subsections": []
        },
        "UNRESTRICTIONS": {
            "content": "Emacs  is  free;  anyone may redistribute copies of Emacs to anyone under the terms stated in\nthe GNU General Public License, a copy of which accompanies each copy of Emacs and which also\nappears in the reference manual.\n\nCopies of Emacs may sometimes be received packaged with distributions of Unix systems, but it\nis never included in the scope of any license covering those systems.   Such  inclusion  vio‐\nlates  the terms on which distribution is permitted.  In fact, the primary purpose of the GNU\nGeneral Public License is to prohibit anyone from attaching any other restrictions to  redis‐\ntribution of Emacs.\n\nRichard  Stallman  encourages  you to improve and extend Emacs, and urges that you contribute\nyour extensions to the GNU library.  Eventually GNU (Gnu's Not Unix) will be a  complete  re‐\nplacement for Unix.  Everyone will be free to use, copy, study and change the GNU system.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "emacsclient(1), etags(1), X(7), xlsfonts(1), xterm(1), xrdb(1)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Emacs was written by Richard Stallman and the Free Software Foundation.  For detailed credits\nand acknowledgments, see the GNU Emacs manual.\n",
            "subsections": []
        },
        "COPYING": {
            "content": "Copyright 1995, 1999-2024 Free Software Foundation, Inc.\n\nPermission  is  granted  to make and distribute verbatim copies of this document provided the\ncopyright notice and this permission notice are preserved on all copies.\n\nPermission is granted to copy and distribute modified versions of  this  document  under  the\nconditions  for verbatim copying, provided that the entire resulting derived work is distrib‐\nuted under the terms of a permission notice identical to this one.\n\nPermission is granted to copy and distribute translations of this document into another  lan‐\nguage,  under  the above conditions for modified versions, except that this permission notice\nmay be stated in a translation approved by the Free Software Foundation.\n\n\nGNU Emacs 29.3                               2022-06-07                                     EMACS(1)",
            "subsections": []
        }
    },
    "summary": "emacs - GNU project Emacs editor",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "emacsclient",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/emacsclient/1/json"
        },
        {
            "name": "etags",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/etags/1/json"
        },
        {
            "name": "X",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/X/7/json"
        },
        {
            "name": "xlsfonts",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xlsfonts/1/json"
        },
        {
            "name": "xterm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xterm/1/json"
        },
        {
            "name": "xrdb",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xrdb/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "The extensible, customizable, self-documenting, real-time display editor.",
        "examples": [
            {
                "description": "Start Emacs and open a file",
                "command": "emacs {{path/to/file}}"
            },
            {
                "description": "Open a file at a specified line number",
                "command": "emacs +{{line_number}} {{path/to/file}}"
            },
            {
                "description": "Run an Emacs Lisp file as a script",
                "command": "emacs --script {{path/to/file.el}}"
            },
            {
                "description": "Start Emacs in console mode (without an X window)",
                "command": "emacs {{-nw|--no-window-system}}"
            },
            {
                "description": "Start an Emacs server in the background (accessible via `emacsclient`)",
                "command": "emacs --daemon"
            },
            {
                "description": "Stop a running Emacs server and all its instances, asking for confirmation on unsaved files",
                "command": "emacsclient --eval '(save-buffers-kill-emacs)'"
            },
            {
                "description": "Save a file in Emacs",
                "command": "<Ctrl x><Ctrl s>"
            },
            {
                "description": "Quit Emacs",
                "command": "<Ctrl x><Ctrl c>"
            }
        ]
    }
}