Next: , Previous: , Up: Moving by Word and Paragraph   [Index]


6.5.3.2 Sub- and Superword Movement—Glasses Mode

Subword’ mode ("camel case") is a buffer-local minor mode. Enabling it changes the definition of a word so that word-based commands stop inside symbols with mixed uppercase and lowercase letters, e.g. "GtkWidget", "EmacsFrameClass", "NSGraphicsContext".

Here we call these mixed case symbols ‘nomenclatures’. Each capitalized (or completely uppercase) part of a nomenclature is called a ‘subword’.

This mode changes the definition of a word so that word commands treat nomenclature boundaries as word boundaries.

Function: subword-mode &optional arg

Toggle subword movement and editing (Subword mode).

ARG

If called from Lisp, toggle the mode if ‘ARG’ is ‘toggle’. Enable the mode if ‘ARG’ is nil, omitted, or is a positive number. Disable the mode if ‘ARG’ is a negative number.

Superword’ mode ("snake case") is a buffer-local minor mode. Enabling it changes the definition of words such that symbols characters are treated as parts of words: e.g., in ‘superword-mode’, "this_is_a_symbol" counts as one word.

Function: superword-mode &optional arg

Toggle superword movement and editing (Superword mode).

ARG

If called from Lisp, toggle the mode if ‘ARG’ is ‘toggle’. Enable the mode if ‘ARG’ is nil, omitted, or is a positive number. Disable the mode if ‘ARG’ is a negative number.

Glasses Minor Mode

Function: glasses-mode &optional arg

Minor mode for making identifiers ‘likeThis’ readable.

When this mode is active, it tries to add virtual separators (like underscores) at places they belong to.

ARG

If called from Lisp, toggle the mode if ‘ARG’ is ‘toggle’. Enable the mode if ‘ARG’ is nil, omitted, or is a positive number. Disable the mode if ‘ARG’ is a negative number.

Global Minor Modes

Function: global-subword-mode &optional arg
Function: global-superword-mode &optional arg

Toggle Subword/Superword mode in all buffers.

ARG

If called from Lisp, enable the mode if ARG is omitted or nil.


Next: What Constitutes a Paragraph, Previous: What Constitutes a Word, Up: Moving by Word and Paragraph   [Index]