Emacs: Usability Problems of Letter-Case Changing Commands

By Xah Lee. Date: . Last updated: .

Emacs Usability Problem, Toggle Letter Case Commands

Emacs has these commands for changing letter case. They are:

There are also “region” versions for each:

(Note: for elisp programing, there are also these functions: upcase, capitalize, downcase, upcase-initials.)

One problem with these commands is that you need to move your cursor to the beginning of the word first. For example, if you have the text “THat”, and your cursor is on the “a”, and you Alt+x downcase-word, but it doesn't do anything because it only start at the cursor point to end of word. It would be nice if it'll just automatically perform the operation on the whole word.

Another problem is that it does not consider the final result. For example, if you have “oncE upon a time …”, and you select the whole sentence and Alt+x upcase-initials-region, it becomes “OncE Upon A Time …”. Note the capital E is not automatically lowered. For elisp programing, the orthogonal precision is nice, but as user commands, it is better to change the whole sentence.

Also, these commands have a “-word” and “-region” variants. You have to chose which one to use. It would be nice if emacs automatically choose the right command depending whether there is text selection.

Solution

Here's a command that combines letter-case commands into one.

Emacs Modernization