![]() GNU Emacs logo | |
Release Status | Maintained |
---|---|
Last Release | 30.1, Feb 23, 2025 |
First Release | 13, Mar 20, 1985 |
Language(s) | C, Emacs Lisp |
Developer(s) | GNU |
Website | gnu.org |

GNU Emacs is a free/libre interpreter for the Emacs Lisp language, with extensions to assist with editing text among other features.[1] It began development in 1984 by Richard Stallman of the GNU project as a part of the Emacs family of editors.[2] The latest version of Emacs is 30.1 released on the 23rd of February 2025.[3]
History
The history of GNU Emacs starts with TECO, a command-based text editor written by Dan Murphy in 1962, originally made for MIT's PDP-1 machines. TECO was continually iterated on and ported to newer machines, such as the PDP-6, PDP-8, PDP-10 (AKA DecSystems 10), and PDP-11.[4] Richard Stallman, inspired by E, an early visual text editor written at Stanford AI Lab, enhanced TECO for the PDP-10 by adding visual editing capabilities in 1974. Stallman also included a "macro" system, allowing users to bind TECO functions to custom commands. This very quickly lead to the spread of user made macro collections like TECMAC and TMACS.[5] Two years later, Guy Steele made efforts to create a more unified set of macros, and with Stallman's help, EMACS was created in late 1976.[6]
EMACS inspired many clones for other operating systems and machines, including EINE and ZWEI written in Lisp Machine Lisp, Multics Emacs in MacLisp, and James Gosling's Emacs (AKA Gosmacs) for Unix in C.[7] Seeking to write a fully free/libre version of Emacs, Stallman made modifications to Gosling's Emacs in 1984, under the impression that he was free to do so.[6] However, UniPress, who had purchased the rights to Gosling's Emacs the year prior,[8] claimed that Stallman did not have the right to redistribute his own version of Gosmacs. Stallman complied with their request by replacing all of Gosling's code with new original code.[6] On March 20, 1985, Stallman shared the first public release of GNU Emacs.[1]
Keybindings
Emacs recognizes several modifier keys, notated as following:
Prefix | Key | Notes |
---|---|---|
C-
|
Control | |
M-
|
Meta | This is the Alt or Option key |
S-
|
Shift | |
s-
|
Super | This is the Windows or Command key |
RET
|
Return | Enter key |
H-
|
Hyper | This key is supported, but no default bindings use it |
A-
|
Alt* | *This is most certainly NOT the same key as Alt. This is a holdover back when keyboards had separate Meta and Alt keys |
Multiple modifiers can be held together, represented by putting them one after the other. For example, C-S-a
represents Ctrl+Shift+a
. Note that C-
keybindings are case insensitive in the terminal,[9] so there is no distinction between C-a
and C-A
. This isn't an issue for the default keybindings, but custom bindings may rely on this. Consider using graphical Emacs if you wish to take advantage of this.
Most keybindings consist of a "prefix" followed by one or more keys. For example, to execute C-x C-s
, you need to press the prefix C-x
first, and then press C-s
. In this case, you can hold down the Control key and press x s
in quick succession. This can help reduce strain on the pinky from frequently pressing the Control key.
Installing
Documentation
Emacs has an extensive library of documentation which covers its functions, variables and keys. It can be found by opening Metahelp with C-h ?
and then pressing the key corresponding to the section you are looking for. You may also use the keys from Metahelp after the C-h
prefix. For example: C-h k
to access describe-key
.
Setting up MELPA
MELPA is a commonly used Emacs package repository which provides more packages you may want to use such as Flycheck for syntax checking. MELPA provides its own "Getting started" page[10] which we suggest reading. We will provide information on setting it up here however.
Before we begin, make sure to move ~/.emacs to ~/.emacs.d/init.el (create the directory if it is missing) to avoid any future confusion. In this init.el, add either of the options in the following code block.
;; Option 1 (Recommended if using Emacs 29.1 or later)
(use-package package
:config
(add-to-list 'package-archives '("melpa". "https://melpa.org/packages") t)
(package-initialize))
;; Option 2
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages") t)
(package-initialize)
After reloading the configuration, you will now be able to have MELPA packages installable with M-x package-install
.
Setting up LSP support
Since 29.1, Emacs has provided Eglot as a way to manage LSPs. If you want to autoload Eglot at startup, then you could use one of the options from the codeblock.
;; Option 1 (Recommended if using Emacs 29.1 or later)
(use-package eglot
:hook prog-mode
:bind (("C-c l" . eglot-code-actions)
("C-c l f b" . eglot-format-buffer)
("C-c l f r" . eglot-format)))
;; Option 2
(require 'eglot)
(add-hook #'prog-mode-hook #'eglot-ensure)
(local-set-key "C-c l c a" 'eglot-code-actions)
(local-set-key "C-c l f b" 'eglot-format-buffer)
(local-set-key "C-c l f r" 'eglot-format)
This will allow Eglot to start when prog-mode
(c-mode
, python-mode
and js-mode
among other programming modes) are enabled and an LSP is found. Eglot commands can be mapped as seen fit.
Evil
Evil (Extensible VI Layer) is a package which provides Emacs with Vi emulation.[11] It is prevalent in Emacs distributions including but not limited to Doom Emacs[12] and Spacemacs[13], though it can be installed in Vanilla Emacs through MELPA.
To install Evil, open package-install
to install evil
. You will then have Evil installed in Emacs.
To enable Evil, add this to your init.el
:
;; Option 1, reccomended if using Emacs 29.1 or over.
(use-package evil
:hook after-init)
;; Option 2
(require 'evil)
(evil-mode 1)
You should now have Evil set up to start as soon as Emacs is opened. You can choose to customise it more to your liking.
References
- ↑ 1.0 1.1 https://www.gnu.org/software/emacs/emacs.html
- ↑ https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/HISTORY
- ↑ https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS.30#n46
- ↑ Murphy, Dan. “The Beginnings of TECO.” IEEE Annals of the History of Computing 31, no. 4 (October 2009): 110–15. https://doi.org/10.1109/MAHC.2009.127.
- ↑ Stallman, Richard M. “EMACS the Extensible, Customizable Self-Documenting Display Editor.” ACM SIGOA Newsletter 2, no. 1–2 (April 1, 1981): 147–56. https://doi.org/10.1145/1159890.806466.
- ↑ 6.0 6.1 6.2 Williams, Sam. Free as in Freedom (2.0): Richard Stallman and the Free Software Revolution. 2nd ed. Boston, MA: Free Software Foundation, 2010.
- ↑ Monnier, Stefan, and Michael Sperber. “Evolution of Emacs Lisp.” Proceedings of the ACM on Programming Languages 4, no. HOPL (June 12, 2020): 74:1-74:55. https://doi.org/10.1145/3386324.
- ↑ UniPress Software, Inc. Advertisement, Byte Magazine, December 1983, 334.
- ↑ https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html
- ↑ https://melpa.org/#/getting-started
- ↑ https://github.com/emacs-evil/evil
- ↑ https://github.com/doomemacs/doomemacs?tab=readme-ov-file#features
- ↑ https://www.spacemacs.org/