O'Reilly logo

Learning GNU Emacs, 3rd Edition by Bill Rosenblatt, Eric S. Raymond, Marc Loy, James Elliott, Debra Cameron

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Word Abbreviations

Word abbreviation mode and dynamic abbreviations are two features that lazy typists will love. The authors proudly include themselves in that category, so you'll be in good company if you choose to explore these features. Dynamic abbreviations are less complex, so we'll discuss them first.

Dynamic Abbreviations

Let's say that you are a scientist writing a paper on invertebrates. You're likely to have many long technical words in your paper, and if you're like us, you get tired of typing long words.

Dynamic abbreviations come to the rescue. After you've typed a long word once, you can simply type a few letters and give the command M-/ (for dabbrev-expand). Emacs inserts the nearest word that starts with that string.

Type: In M-/

image with no caption

Emacs inserts the last word starting with in, in this case, interesting.

Interesting was not the word we were hoping for; it's invertebrates we wanted. Without moving the cursor, type M-/ again.

Type: M-/

image with no caption

Emacs inserts the word Invertebrates, which is what we wanted.

The word being expanded need not be earlier in the file to be considered nearest. Emacs looks behind and ahead of the cursor position to find words it can expand. If there are eligible words that are equidistant above and below the cursor position both, Emacs selects ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required