summaryrefslogtreecommitdiff
path: root/devdocs/elisp/window-point.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/window-point.html')
-rw-r--r--devdocs/elisp/window-point.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/elisp/window-point.html b/devdocs/elisp/window-point.html
new file mode 100644
index 00000000..a6ae21ca
--- /dev/null
+++ b/devdocs/elisp/window-point.html
@@ -0,0 +1,19 @@
+ <h3 class="section">Windows and Point</h3> <p>Each window has its own value of point (see <a href="point">Point</a>), independent of the value of point in other windows displaying the same buffer. This makes it useful to have multiple windows showing one buffer. </p> <ul> <li> The window point is established when a window is first created; it is initialized from the buffer’s point, or from the window point of another window opened on the buffer if such a window exists. </li>
+<li> Selecting a window sets the value of point in its buffer from the window’s value of point. Conversely, deselecting a window sets the window’s value of point from that of the buffer. Thus, when you switch between windows that display a given buffer, the point value for the selected window is in effect in the buffer, while the point values for the other windows are stored in those windows. </li>
+<li> As long as the selected window displays the current buffer, the window’s point and the buffer’s point always move together; they remain equal. </li>
+</ul> <p>Emacs displays the cursor, by default as a rectangular block, in each window at the position of that window’s point. When the user switches to another buffer in a window, Emacs moves that window’s cursor to where point is in that buffer. If the exact position of point is hidden behind some display element, such as a display string or an image, Emacs displays the cursor immediately before or after that display element. </p> <dl> <dt id="window-point">Function: <strong>window-point</strong> <em>&amp;optional window</em>
+</dt> <dd>
+<p>This function returns the current position of point in <var>window</var>. For a nonselected window, this is the value point would have (in that window’s buffer) if that window were selected. The default for <var>window</var> is the selected window. </p> <p>When <var>window</var> is the selected window, the value returned is the value of point in that window’s buffer. Strictly speaking, it would be more correct to return the top-level value of point, outside of any <code>save-excursion</code> forms. But that value is hard to find. </p>
+</dd>
+</dl> <dl> <dt id="set-window-point">Function: <strong>set-window-point</strong> <em>window position</em>
+</dt> <dd>
+<p>This function positions point in <var>window</var> at position <var>position</var> in <var>window</var>’s buffer. It returns <var>position</var>. </p> <p>If <var>window</var> is selected, this simply does <code>goto-char</code> in <var>window</var>’s buffer. </p>
+</dd>
+</dl> <dl> <dt id="window-point-insertion-type">Variable: <strong>window-point-insertion-type</strong>
+</dt> <dd><p>This variable specifies the marker insertion type (see <a href="marker-insertion-types">Marker Insertion Types</a>) of <code>window-point</code>. The default is <code>nil</code>, so <code>window-point</code> will stay behind text inserted there. </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/Window-Point.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html</a>
+ </p>
+</div>