Questions tagged [region]

The text between the point and mark in a buffer.

A region is all text in a buffer between the point (the text-cursor position) and the mark (if it exists). With transient-mark-mode on, the region text is highlighted.

165 questions
33
votes
8 answers

How to select non-contiguous regions in Emacs?

Suppose that I have already selected some text in the current buffer. Is it possible to select another stretch of text, while keeping the previous selection (and so on)? Added: One motivation for this functionality is as follows: Assume that I have…
Name
  • 7,689
  • 4
  • 38
  • 84
25
votes
1 answer

Elisp for applying command to only the selected region

Say, I have some code like this: (defun some-function () (interactive) ;; do something ) Now I want some-function to operate only on the selected region in the buffer ? How can I do that ? Also, can there be two separate code path for doing…
Sibi
  • 3,603
  • 2
  • 22
  • 35
19
votes
4 answers

What is the usefulness of `exchange-point-and-mark`?

The exchange-point-and-mark command is bound to C-x C-x, but I cannot think of any use cases that would make it deserving of such a prominent binding. How can I use the exchange-point-and-mark to improve my editing technique?
Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77
15
votes
3 answers

Shift+Up isn't recognized by Emacs in a terminal

Very often I use Shift+Up/Down to select a region in Emacs. It works fine in GUI mode, but when emacs is invoked with -nw option I can select lines only with Shift+Down. The Shift+Up doesn't work, I get this error message in the minibuffer: