Книга: 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. |
- Changing Passwords in a Batch
- Temporarily Changing User Identity with the su Command
- Changing Runlevels
- Changing Directories with cd
- Changing File Access Permissions with chmod
- Changing to NNRP Reader Mode
- Changing drive types
- Changing or deleting the volume label
- Changing shared folder settings
- Reviewing and changing template settings
- Setting a separator page and changing print device mode
- Changing the printer port