|Suggestions on Emacs's mark-word Command
||[Dec. 9th, 2008|01:16 pm]
• Suggestions on Emacs's mark-word Command|
plain text version follows. (formatting is screwed up)
------------------------- Suggestions on Emacs's mark-word Command
Xah Lee, 2008-12-09
Emacs has a command to select the current word, mark-word, with default shortcut of “Alt+@”. Selecting the current word is a frequently needed operation. However, emacs's mark-word command is inconvenient. It does not select the whole word. It only select from the cursor position to the end of the word. For example, if your word is “transmission”, and your cursor is at the “m”, then it will select just “mission”. To select the whole word, you need to move the cursor to the beginning of the word first. Also, mark-word has a feature that if you repeat the command, then it extend the selection to the next word to the right.
Here we suggest a improvement. We want a command that select the whole word. When repeated, it should select the next larger syntactic unit. In human languages, that would be sentence, then paragraph, then whole buffer. In computer languages, the sequence would be: current identifier, current expression, current construct (or line), current block or defun. Similarly, if the lang is lisp, it simply extend the selection to the next outer parens. For detailed example of this, see: A Text Editor Feature: Extend Selection By Semantic Unit.
( Read more...Collapse )