Книга: Learning GNU Emacs, 3rd Edition

2.5.2 Changing Capitalization

2.5.2 Changing Capitalization

Mistakes in capitalization are also common and annoying typing errors. Emacs has some special commands for fixing capitalization. To capitalize the first letter of any word, put the cursor on the first letter and press M-c. To put a word in lowercase, press M-l. To put a word in uppercase, press M-u. The key bindings here are mnemonic: Meta followed by c for capitalize, l for lowercase, and u for uppercase. Note that if the cursor is in the middle of a word, Emacs takes action only from the character under the cursor to the end of the word. You can easily use M-l to lowercase the second half of a word, and so on.

If you notice that the word you just typed is incorrect, you can use the same commands prefaced by Meta- (press and hold Meta followed by a hyphen). This corrects the previous word without moving the cursor. If the cursor is positioned in the middle of a word, using Meta- before a command causes it to work on the first part of the word (the part preceding the cursor), rather than the part following the cursor.

For example, starting with abcdefghij:

If you press: You'll get:
Meta - u abcdEFGHIJ_
Meta - M-u ABCDefghij
M-c abcdEfghij_
Meta - M-c Abcdefghij

Table 2-10 summarizes the capitalization commands.

Table 2-10. Capitalization commands

Keystrokes Command name Action
M-c capitalize-word Capitalize first letter of word.
M-u upcase-word Uppercase word.
M-l downcase-word Lowercase word.
Meta - M-c negative-argument; capitalize-word Capitalize previous word.
Meta - M-u negative-argument; upcase-word Uppercase previous word.
Meta - M-l negative-argument; downcase-word Lowercase previous word.

Оглавление книги


Генерация: 2.287. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз