EmacsWiki: Do What I Mean (original) (raw)
Some Emacs functions and variables have “dwim” in their name somewhere. DWIM stands for “Do What I Mean”. Usually these functions try to do the right thing, depending on the context.
For example, consider the DiredMode variable dired-dwim-target
. If non-nil
, this lets Dired know that you’d like it to guess a default target for commands like copy and move. Say you have your Frame split into two Dired Windows; in this case, Dired will assume that you want to copy/move the file from the one into the other. This is cool stuff.
List of DWIM-like extensions
- BackToIndentationOrBeginning goes to the line’s first non-whitespace character, or beginning if already there.
- kill-and-join-forward kills and joins lines, removing indentation.
- AutoPairs inserts paired delimiters (‘
(
’ and ‘)
’), depending on the context. - WholeLineOrRegion makes ‘
M-w
’ and ‘C-w
’ copy and cut the current line when no text is selected. - TabKey2/Smart Tab provides word completion or indents the line or region when you hit
<tab>
. - typopunct.el provides “smart quotes” and other typographical punctuation marks when you hit ‘
"
’, ‘'
’ and ‘-
’.
See WikiPedia:DWIM.