Emacs is an extensible text editor that can be customized by writing Lisp code.
Why is Emacs a good choice for Python coding?
Emacs is designed to be customized via the built-in Lisp interpreter and package manager. The package manager, named package.el, has menus for handling installation. The largest Lisp Package Archive is Melpa, which provides automatic updates from upstream sources.
Macros are useful for performing repetitive actions in Emacs. A macro is just a recording of a previous set of keystrokes that can be replayed to perform future actions.
Hooks, which are Lisp variables that hold lists of functions to call, provide an extension mechanism for Emacs. For example,
kill-emacs-hook runs before exiting Emacs so functions can be loaded into that hook to perform necessary actions before the exiting completes.
General Emacs resources
- GNU Emacs Manual provides an official in-depth review for how to use Emacs.
- Emacs as a Python IDE is a detailed walkthrough of setting up Emacs for Python development.
- Emacs – the Best Python Editor? continues the excellent Real Python series showing how to get started with editors. In addition to this Emacs post, there are also posts on Vim and Sublime Text 3 specifically for Python development.
- Emacs Redux is a blog with tips and tricks for how to use Emacs effectively.
- Emacs Rocks is a video tutorial series for Emacs.
- What the .emacs.d?! provides a bunch of tiny optimizations for Emacs’ workflow.
Notable Elisp Packages
- Magit allows the user to inspect and modify Git repositories from within Emacs.
- company-mode creates a modular in-buffer completion framework.
- Flycheck provides syntax checking.
- anaconda-mode is specific to Python development and allows code navigation, documentation lookup and code completion. The jedi library is used under the hood.
Popular user configurations
- Prelude is an enhanced Emacs version 24 distribution.
- A reasonable Emacs config shows a batteries-includes Emacs configuration bundle.
- Emacs settings is a repository of configurations used in the Emacs Rocks screencasts.
- Spacemacs mashes together Emacs’ extensibility and Vim’s ergonomic text editing features.