Next: Whitespace Manipulation, Previous: Case Modification Commands, Up: Modification Commands [Contents][Index]
Hemlock provides a number of transposition commands. A transposition command swaps the "things" before and after the point and moves forward one "thing". Just how a "thing" is defined depends on the particular transposition command. Transposition commands, particularly Transpose Characters and Transpose Words, are useful for correcting typos. More obscure transposition commands can be used to amaze your friends and demonstrate your immense knowledge of exotic Emacs commands.
To the uninitiated, the behavior of transposition commands may seem mysterious; this has led some implementors to attempt to improve the definition of transposition, but right-thinking people will accept no substitutes. The Emacs transposition definition used in Hemlock has two useful properties:
This command exchanges the characters on either side of the point and moves forward, unless at the end of a line, in which case it transposes the previous two characters without moving.
This command transposes the previous and current line, moving down to the next line. With a zero argument, it transposes the current line and the line the mark is on.
This command transposes the previous word and the current or next word.
This command transposes two regions with endpoints defined by the mark stack and point. To use this command, place three marks (in order) at the start and end of the first region, and at the start of the second region, then place the point at the end of the second region. Unlike the other transposition commands, a second use will simply undo the effect of the first use, and to do even this, you must reactivate the current region.
Next: Whitespace Manipulation, Previous: Case Modification Commands, Up: Modification Commands [Contents][Index]