summaryrefslogtreecommitdiff
path: root/devdocs/elisp/the-region.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/the-region.html
new repository
Diffstat (limited to 'devdocs/elisp/the-region.html')
-rw-r--r--devdocs/elisp/the-region.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/devdocs/elisp/the-region.html b/devdocs/elisp/the-region.html
new file mode 100644
index 00000000..569ec7b7
--- /dev/null
+++ b/devdocs/elisp/the-region.html
@@ -0,0 +1,14 @@
+ <h3 class="section">The Region</h3> <p>The text between point and the mark is known as <em>the region</em>. Various functions operate on text delimited by point and the mark, but only those functions specifically related to the region itself are described here. </p> <p>The next two functions signal an error if the mark does not point anywhere. If Transient Mark mode is enabled and <code>mark-even-if-inactive</code> is <code>nil</code>, they also signal an error if the mark is inactive. </p> <dl> <dt id="region-beginning">Function: <strong>region-beginning</strong>
+</dt> <dd><p>This function returns the position of the beginning of the region (as an integer). This is the position of either point or the mark, whichever is smaller. </p></dd>
+</dl> <dl> <dt id="region-end">Function: <strong>region-end</strong>
+</dt> <dd><p>This function returns the position of the end of the region (as an integer). This is the position of either point or the mark, whichever is larger. </p></dd>
+</dl> <p>Instead of using <code>region-beginning</code> and <code>region-end</code>, a command designed to operate on a region should normally use <code>interactive</code> with the ‘<samp>r</samp>’ specification to find the beginning and end of the region. This lets other Lisp programs specify the bounds explicitly as arguments. See <a href="interactive-codes">Interactive Codes</a>. </p> <dl> <dt id="use-region-p">Function: <strong>use-region-p</strong>
+</dt> <dd>
+<p>This function returns <code>t</code> if Transient Mark mode is enabled, the mark is active, and there is a valid region in the buffer. This function is intended to be used by commands that operate on the region, instead of on text near point, when the mark is active. </p> <p>A region is valid if it has a non-zero size, or if the user option <code>use-empty-active-region</code> is non-<code>nil</code> (by default, it is <code>nil</code>). The function <code>region-active-p</code> is similar to <code>use-region-p</code>, but considers all regions as valid. In most cases, you should not use <code>region-active-p</code>, since if the region is empty it is often more appropriate to operate on point. </p>
+</dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Region.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Region.html</a>
+ </p>
+</div>