Word Abbreviation Mode
Word abbreviation mode lets you define abbreviations for special words and phrases. There are many ways to use it. Traditionally, abbreviation mode is used so that you don’t have to type long words or phrases in their entirety. For example, let’s say you are writing a contract that repeatedly references the National Institute of Standards and Technology, and you are not allowed to use an acronym. Rather than typing the full name, you can define the abbreviation nist. Once you have made this definition, Emacs inserts the full name whenever you type the abbreviation nist, followed by a space or punctuation mark. Emacs watches for you to type an abbreviation, then expands it automatically as soon as you press SPACE or a punctuation mark.
Before showing you how to get into word abbreviation mode and define your abbreviation list, we’ll start with an example. Our favorite nontraditional use for word abbreviation mode is to correct misspellings as you type. Almost everyone has a dozen or so words that they habitually type incorrectly because of some worn neural pathways. You can simply tell Emacs that these misspellings are “abbreviations” for the correct versions, and Emacs fixes the misspellings every time you type them; you may not even notice that you typed the word wrong before Emacs fixes it. So assume that you’ve entered abbreviation mode, and that you’ve defined receive as an abbreviation for recieve; now, as you’re typing, you make an innocent mistake. ...
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