File: subword.el.html

This package provides the subword minor mode, which merges the old remap-based subword.el (derived from cc-mode code) and cap-words.el, which takes advantage of core Emacs word-motion-customization functionality.

In spite of GNU Coding Standards, it is popular to name a symbol by mixing uppercase and lowercase letters, e.g. "GtkWidget",
"EmacsFrameClass", "NSGraphicsContext", etc. 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:

 Nomenclature Subwords
 ===========================================================
 GtkWindow => "Gtk" and "Window"
 EmacsFrameClass => "Emacs", "Frame" and "Class"
 NSGraphicsContext => "NS", "Graphics" and "Context"

The subword oriented commands defined in this package recognize subwords in a nomenclature to move between them and to edit them as words. You also get a mode to treat symbols as words instead, called superword-mode(var)/superword-mode(fun) (the opposite of subword-mode(var)/subword-mode(fun)).

To make the mode turn on automatically, put the following code in your .emacs:

(add-hook 'c-mode-common-hook 'subword-mode)


To make the mode turn superword-mode(var)/superword-mode(fun) on automatically for only some modes, put the following code in your .emacs:

(add-hook 'c-mode-common-hook 'superword-mode)


Acknowledgment: The regular expressions to detect subwords are mostly based on the old c-forward-into-nomenclature originally contributed by Terry_Glanfield dot Southern at rxuk dot xerox dot com.

TODO: ispell-word.

Defined variables (16)

global-subword-modeNon-nil if Global Subword mode is enabled.
global-subword-mode-hookHook run after entering or leaving ‘global-subword-mode’.
global-superword-modeNon-nil if Global Superword mode is enabled.
global-superword-mode-hookHook run after entering or leaving ‘global-superword-mode’.
subword-backward-functionFunction to call for backward subword movement.
subword-backward-regexpRegexp used by ‘subword-backward-internal’.
subword-empty-char-tableAssigned to ‘find-word-boundary-function-table’ while we’re
subword-find-word-boundary-function-tableAssigned to ‘find-word-boundary-function-table’ in
subword-forward-functionFunction to call for forward subword movement.
subword-forward-regexpRegexp used by ‘subword-forward-internal’.
subword-modeNon-nil if Subword mode is enabled.
subword-mode-hookHook run after entering or leaving ‘subword-mode’.
subword-mode-mapKeymap used in ‘subword-mode’ minor mode.
superword-modeNon-nil if Superword mode is enabled.
superword-mode-hookHook run after entering or leaving ‘superword-mode’.
superword-mode-mapKeymap used in ‘superword-mode’ minor mode.

Defined functions (18)

c-subword-mode(&optional ARG)
capitalized-words-mode(&optional ARG)
global-subword-mode(&optional ARG)
global-superword-mode(&optional ARG)
subword-backward(&optional ARG)
subword-backward-kill(ARG)
subword-capitalize(ARG)
subword-downcase(ARG)
subword-find-word-boundary(POS LIMIT)
subword-forward(&optional ARG)
subword-kill(ARG)
subword-left(&optional ARG)
subword-mark(ARG)
subword-mode(&optional ARG)
subword-right(&optional ARG)
subword-transpose(ARG)
subword-upcase(ARG)
superword-mode(&optional ARG)

Defined faces (0)