Next: Other Commands, Previous: Hungry Deletion of Whitespace, Up: Commands [Contents][Index]
In spite of the GNU Coding Standards, it is popular to name a symbol by mixing uppercase and lowercase letters, e.g., ‘GtkWidget’, ‘EmacsFrameClass’, or ‘NSGraphicsContext’. Here we call these mixed case symbols nomenclatures. Also, each capitalized (or completely uppercase) part of a nomenclature is called a subword. Here are some examples:
The subword minor mode replaces the basic word oriented movement and editing commands with variants that recognize subwords in a nomenclature and treat them as separate words:
forward-word c-forward-subwordbackward-word c-backward-subwordmark-word c-mark-subwordkill-word c-kill-subwordbackward-kill-word c-backward-kill-subwordtranspose-words c-transpose-subwordscapitalize-word c-capitalize-subwordupcase-word c-upcase-subworddowncase-word c-downcase-subwordNote that if you have changed the key bindings for the word oriented commands in your .emacs or a similar place, the keys you have configured are also used for the corresponding subword oriented commands.
Type C-c C-w to toggle subword mode on and off. To make the mode turn on automatically, put the following code in your .emacs:
(add-hook 'c-mode-common-hook (lambda () (subword-mode 1)))
As a bonus, you can also use subword-mode in non-CC Mode
buffers by typing M-x subword-mode.
Next: Other Commands, Previous: Hungry Deletion of Whitespace, Up: Commands [Contents][Index]