Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Emacs editing environment, Part 6: Customize your Emacs world

Get going with this famous open source editor

Michael Stutz, Author, Consultant
Photo of Michael Stutz
Michael Stutz is author of The Linux Cookbook, which he also designed and typeset using only open source software. His research interests include digital publishing and the future of the book. He has used various UNIX operating systems for 20 years.

Summary:  This tutorial, the sixth in a series, walks you through some of the useful ways you can customize and configure the Emacs environment. Learn how to change everything about the Emacs environment to your liking, from the behavior of minor modes to the default key bindings. Along the way, figure out how to set variables, make all your customizations automatic with a startup file, save and recall any window and frame customizations that you make, and use the easy customizer that comes built into Emacs.

View more content in this series

Date:  02 Oct 2007
Level:  Intermediate

Activity:  23216 views
Comments:  

Before you start

Learn what to expect from this tutorial, and how to get the most out of it.

About this series

The Emacs editing environment is a favorite of UNIX® developers. It's known around the world as the king of editors, but many users find it has a bit of a learning curve. The Emacs environment doesn't seem intuitive at first glance, and it doesn't work like other editors and word processors. But learning Emacs doesn't have to be difficult. Once you get going, you'll see how intuitive it is and become more comfortable with it after each use. This tutorial series (see Resources) shows you the way, taking you from the basics of Emacs, such as its features, philosophy, key-command layout, and methods for editing text, through many of its powerful editing features.

After completing this series (see Resources), you'll be able to comfortably use Emacs for everyday editing, be well on your way to Emacs proficiency, and have a good feel for many of the advanced capabilities of Emacs.

About this tutorial

This is the sixth in a series of tutorials on learning Emacs. Previous tutorials in this series took you through the basics; this intermediate-level, hands-on tutorial builds on what you learned in the early tutorials, and shows readers already familiar with the rudimentary controls of Emacs how to customize and tool the system for their specific needs.

In this tutorial, you learn how to customize the system in various ways, changing its behavior and getting it to work the way you want it to. You also learn how to set and examine the Emacs variables that change the behavior of the application, change the way keys and modes work, make your customizations happen automatically with Emacs Lisp code in an init file, remember your window and frame modifications, and use the built-in customize buffer utility for an easy approach to changing and managing various Emacs settings.

Objectives

This tutorial shows you how to customize and configure your Emacs editing environment, from key bindings to the behavior of modes.

After working through this tutorial, you'll know how to change every aspect of the Emacs editing environment, and how to save your customizations so that they can be recalled later.

Prerequisites

Before working through this tutorial, you should complete the previous tutorials in this series. They lay down the basic foundation, and explain many of the Emacs concepts you use in this tutorial (see the Resources section).

The special Emacs notation for representing keystrokes, which is used in this tutorial and throughout the series, is described in the introduction of the first tutorial of the series, "Learning the Emacs editing environment, Part 1: The basics of Emacs" (see Resources).

Although this tutorial is written for all levels of UNIX expertise, it's helpful if you have at least a rudimentary understanding of the UNIX file system:

  • Files

  • Directories

  • Permissions

  • File system hierarchy

System requirements

This tutorial requires a user account on any UNIX-based system that has a recent copy of Emacs installed.

There are several varieties of Emacs; the original and most popular is GNU Emacs, which is published online by the GNU Project (see Resources).

You should have a recent copy of GNU Emacs—one that is at version 20 or greater. Versions 20 and 21 are the most commonly available, and development snapshots of version 22 are also available. This tutorial works with any of these versions for Emacs. If your system is running something older, it's time to upgrade.

To know what version of Emacs you have running, use the GNU-style --version flag:

$ emacs --version
GNU Emacs 22.0.91.1
Copyright (C) 2006 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$ 

Because a portion of this tutorial deals with graphical elements of the Emacs operation in the X Window System environment, you should also have an X server up and running.

1 of 10 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX, Open source
ArticleID=259318
TutorialTitle=Emacs editing environment, Part 6: Customize your Emacs world
publish-date=10022007
author1-email=stutz@dsl.org
author1-email-cc=mmccrary@us.ibm.com