summaryrefslogtreecommitdiff
path: root/devdocs/elisp/moving-markers.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/moving-markers.html
new repository
Diffstat (limited to 'devdocs/elisp/moving-markers.html')
-rw-r--r--devdocs/elisp/moving-markers.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/devdocs/elisp/moving-markers.html b/devdocs/elisp/moving-markers.html
new file mode 100644
index 00000000..f6041624
--- /dev/null
+++ b/devdocs/elisp/moving-markers.html
@@ -0,0 +1,23 @@
+ <h3 class="section">Moving Marker Positions</h3> <p>This section describes how to change the position of an existing marker. When you do this, be sure you know whether the marker is used outside of your program, and, if so, what effects will result from moving it—otherwise, confusing things may happen in other parts of Emacs. </p> <dl> <dt id="set-marker">Function: <strong>set-marker</strong> <em>marker position &amp;optional buffer</em>
+</dt> <dd>
+<p>This function moves <var>marker</var> to <var>position</var> in <var>buffer</var>. If <var>buffer</var> is not provided, it defaults to the current buffer. </p> <p>If <var>position</var> is <code>nil</code> or a marker that points nowhere, then <var>marker</var> is set to point nowhere. </p> <p>The value returned is <var>marker</var>. </p> <div class="example"> <pre class="example">(setq m (point-marker))
+ ⇒ #&lt;marker at 4714 in markers.texi&gt;
+</pre>
+<pre class="example">(set-marker m 55)
+ ⇒ #&lt;marker at 55 in markers.texi&gt;
+</pre>
+<pre class="example">(setq b (get-buffer "foo"))
+ ⇒ #&lt;buffer foo&gt;
+</pre>
+<pre class="example">(set-marker m 0 b)
+ ⇒ #&lt;marker at 1 in foo&gt;
+</pre>
+</div> </dd>
+</dl> <dl> <dt id="move-marker">Function: <strong>move-marker</strong> <em>marker position &amp;optional buffer</em>
+</dt> <dd><p>This is another name for <code>set-marker</code>. </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/Moving-Markers.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Moving-Markers.html</a>
+ </p>
+</div>