emacs-diffs
[Top][All Lists]
Advanced

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

master c12852bbf61: Document and announce 'marker-last-position'


From: Martin Rudalics
Subject: master c12852bbf61: Document and announce 'marker-last-position'
Date: Sat, 16 Mar 2024 05:47:07 -0400 (EDT)

branch: master
commit c12852bbf61ebb9ae124033deb427b15ce1a2ffb
Author: Martin Rudalics <rudalics@gmx.at>
Commit: Martin Rudalics <rudalics@gmx.at>

    Document and announce 'marker-last-position'
    
    * doc/lispref/markers.texi (Information from Markers): Document
    'marker-last-position'.
    * etc/NEWS: Announce 'marker-last-position'.
    * src/window.c (window_restore_killed_buffer_windows): Minor
    doc-string fix.
    * doc/lispref/windows.texi (Window Configurations): Minor fix.
---
 doc/lispref/markers.texi |  7 +++++++
 doc/lispref/windows.texi |  4 ++--
 etc/NEWS                 |  5 +++++
 src/window.c             | 12 ++++++------
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi
index 3037790692c..28ad0ff73c0 100644
--- a/doc/lispref/markers.texi
+++ b/doc/lispref/markers.texi
@@ -283,6 +283,13 @@ This function returns the position that @var{marker} 
points to, or
 @code{nil} if it points nowhere.
 @end defun
 
+@defun marker-last-position marker
+This function returns the last known position of @var{marker} in its
+buffer.  It behaves like @code{marker-position} with one exception: If
+the buffer of @var{marker} has been killed, it returns the last position
+of @var{marker} in that buffer before it was killed.
+@end defun
+
 @defun marker-buffer marker
 This function returns the buffer that @var{marker} points into, or
 @code{nil} if it points nowhere.
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 2e2fdee422b..eef05d94fdb 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -6424,8 +6424,8 @@ windows are restored by @code{window-state-put}.
 The second argument specifies a list of entries for @emph{all} windows
 whose previous buffers have been found dead at the time
 @code{set-window-configuration} or @code{window-state-put} tried to
-restore it in that window (minibuffer windows are excluded).  This means
-that the function may also delete windows which were found live by
+restore them (minibuffer windows are excluded).  This means that the
+function may also delete windows which were found live by
 @code{set-window-configuration}.
 
 Each entry in the list that is passed as the second argument to the
diff --git a/etc/NEWS b/etc/NEWS
index a654d2d8d79..8cad9412def 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1816,6 +1816,11 @@ improves performance.  Such a Lisp program can then use 
the
 It returns the name of a buffer before the last time it was renamed or
 killed.
 
+** New primitive 'marker-last-position'.
+It returns the last position of MARKER in its buffer even if that buffer
+has been killed.
+
+
 ** Functions and variables to transpose sexps
 
 +++
diff --git a/src/window.c b/src/window.c
index b69f4719d93..748ad9e77d4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -8711,12 +8711,12 @@ third argument is the symbol `configuration' if the 
windows are
 restored by `set-window-configuration' and the symbol `state' if the
 windows are restored by `window-state-put'.
 
-The second argument specifies a list of entries for all windows
-whose previous buffers have been found dead at the time
-`set-window-configuration' or `window-state-put' tried to restore it in
-that window (minibuffer windows are excluded).  This means that the
-function specified by this variable may also delete windows which were
-found to be alive by `set-window-configuration'.
+The second argument specifies a list of entries for all windows whose
+previous buffers have been found dead at the time
+`set-window-configuration' or `window-state-put' tried to restore them
+(minibuffer windows are excluded).  This means that the function
+specified by this variable may also delete windows which were found to
+be alive by `set-window-configuration'.
 
 Each entry is a list of six values: the window whose buffer was found
 dead, the dead buffer or its name, the positions of window-start and



reply via email to

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