Chapter 1. Customizing Emacs
This chapter introduces basic Emacs customizations, and teaches some Emacs Lisp along the way. One of the simplest and most common customizations is to move commands from one key to another. Perhaps you don't like Emacs's two-key sequence for saving files (C-x C-s) because you've been using some other editor where save is simply C-s. Or perhaps you sometimes accidentally type C-x C-c, which exits Emacs, when you mean to press only C-x, and you'd like accidental presses of C-x C-c to have a less drastic effect. Or perhaps, as in the example that follows, you need to work around an unusual expectation that Emacs has about your keyboard.
Backspace and Delete
Imagine you're typing the word "Lisp" and you accidentally type "List." To correct your typo, do you press the BACKSPACE key or the DELETE key?
The answer depends on your keyboard, but it's not merely a question of how the key is labeled. Sometimes the key is labeled "Backspace," sometimes it's labeled "Delete," sometimes "Erase," and sometimes it's not labeled with a word but has a left-pointing arrow or some other graphic. To Emacs, what matters isn't the label but the numeric character code that the key generates when pressed. Regardless of the label on the key, the "move left and erase the previous character" key may generate an ASCII "backspace" code (decimal 8, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access