Emacs is an extensible text editor that can be customized by writing Emacs Lisp (Elisp) code.

Emacs community logo.

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.

Emacs is an implementation of the text editors and IDEs concept. Learn how these parts fit together in the development environments chapter or view all topics.

Python plus Emacs resources

Emacs is programming language agnostic by design so it takes some effort to customize the editor as a Python-specific development environment. The following resources will walk you through the setups that other developers have created for working with Python.

General Emacs resources

Emacs, like any powerful tool, takes significant intentional practice to use properly. These resources provide instructions for becoming comfortable with the editor itself rather than specific Python environment configuration advice.

Programming Emacs with Elisp

Emacs can be completely customized and rewritten by using the Emacs-specific Lisp programming language named Emacs Lisp (Elisp). The ability to completely modify the editor is part of what led to the old joke "a great operating system, lacking only a decent editor". Nevertheless, Elisp is what gives Emacs its text editing power despite the perception that the editor is overkill for working with text.

These tutorials will help you learn the Elisp language and use it to modify Emacs for your own purposes.

Notable Elisp Packages

Elisp is the LISP programming language dialect that Emacs using for adding and customizing functionality in the editor. The following Elisp packages are existing Elisp libraries that many developers using Emacs incorporate into their environment.

Popular user configurations

Numerous custom Emacs user configurations exist that bundle together custom Elisp packages and libraries to handle creating a powerful integrated development environment. I recommend trying to configure Emacs yourself before you dive into any of these configurations so it is easier to learn base Emacs rather than get distracted by the customizations.

  • 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.

What's next once your development environment is set up?

Tell me about using the Vim editor for Python development.

I want to learn how to code a Python web application using a framework.

I want to know about working with data in Python.

Sign up for a monthly email with Full Stack Python tutorials. No spam ever.

Matt Makai 2012-2018