help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mixing argument types


From: Emanuel Berg
Subject: Re: mixing argument types
Date: Mon, 27 Aug 2018 22:07:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Rodolfo Medina wrote:

> And region-beginning/end...?

You can set the mark with C-SPC
(`set-mark-command'), and then move point (the
cursor) around with the usual keys. You should
now see the effect of this in the buffer.
The area covered is called the region. Often,
functions operate on this region because it is
a natural way to specify what part of the
buffer should be affected by a command: first
the user sets the region, then the command is
invoked, and because there is a region, the
command affects that, rather than the whole
buffer (or something else, depending on the
command).

In Elisp code, you can find out if there is
a region with (use-region-p). You can even,
right now reading this, evaluate that (with
`C-x C-e', `eval-last-sexp') with and without
a region: it should evaluate to t or nil
accordingly.

In the Elisp code, if there is a region you use
`region-beginning' and `region-end' to delimit
the part of the buffer it covers.

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]