ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial
Web Hosting by 1&1

11.3 Operating on the Region

Once you have a region, here are some of the ways you can operate on it:

Most commands that operate on the text in the region have the word region in their names.

Some commands have a default behavior when the mark is inactive, but operate on the text in the region if the mark is active. For example, M-$ (ispell-word) normally checks the spelling of the word at point, but it checks the text in the region if the region is active (see Spelling). Normally, such commands use their default behavior if the region is empty (i.e., if mark and point are at the same position). If you want them to operate on the empty region, change the variable use-empty-active-region to t.

If you enable Delete Selection mode, a minor mode, then inserting text while the mark is active causes the selected text to be deleted first. This also deactivates the mark. Many graphical applications follow this convention, but Emacs does not. To toggle Delete Selection mode on or off, type M-x delete-selection-mode. Another effect of this mode is that some keys, such as <DEL> and C-d, always kill the region if one exists.

blog comments powered by Disqus