diff options
| author | Eli Zaretskii | 2024-03-15 14:22:14 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2024-03-15 14:22:14 +0200 |
| commit | bf3d296d24ea24fb707a9410fccd745523347d2a (patch) | |
| tree | 3a17f7cde11c18889eaa638881e90621bc7fac09 | |
| parent | 3858e4f22946dc49d2d3dde5f45a65eab83fd7aa (diff) | |
| download | emacs-bf3d296d24ea24fb707a9410fccd745523347d2a.tar.gz emacs-bf3d296d24ea24fb707a9410fccd745523347d2a.zip | |
; Fix documentation of a recent change (bug#68235)
* etc/NEWS:
* doc/lispref/windows.texi (Window Configurations): Improve
wording of 'window-restore-killed-buffer-windows's doc.
* src/window.c (syms_of_window)
<window-restore-killed-buffer-windows>: Doc fix.
* etc/NEWS:
* doc/lispref/buffers.texi (Buffer Names): Document
'buffer-last-name'.
| -rw-r--r-- | doc/lispref/buffers.texi | 6 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 39 | ||||
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | src/window.c | 54 |
4 files changed, 60 insertions, 45 deletions
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 77f5f09c7bd..5375eb64155 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi | |||
| @@ -371,6 +371,12 @@ See the related function @code{generate-new-buffer} in @ref{Creating | |||
| 371 | Buffers}. | 371 | Buffers}. |
| 372 | @end defun | 372 | @end defun |
| 373 | 373 | ||
| 374 | @defun buffer-last-name &optional buffer | ||
| 375 | This function returns the previous name of @var{buffer}, before it was | ||
| 376 | killed or before the last time it was renamed. If nil or omitted, | ||
| 377 | @var{buffer} defaults to the current buffer. | ||
| 378 | @end defun | ||
| 379 | |||
| 374 | @node Buffer File Name | 380 | @node Buffer File Name |
| 375 | @section Buffer File Name | 381 | @section Buffer File Name |
| 376 | @cindex visited file | 382 | @cindex visited file |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 45d67ba4946..8fa4e57b153 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -6376,8 +6376,8 @@ fine-tune that behavior. | |||
| 6376 | @defvar window-restore-killed-buffer-windows | 6376 | @defvar window-restore-killed-buffer-windows |
| 6377 | This variable specifies how @code{set-window-configuration} and | 6377 | This variable specifies how @code{set-window-configuration} and |
| 6378 | @code{window-state-put} shall handle a window whose buffer has been | 6378 | @code{window-state-put} shall handle a window whose buffer has been |
| 6379 | killed since the corresponding configuration or state was made. Any | 6379 | killed since the corresponding configuration or state was recorded. Any |
| 6380 | such window may be live - in which case it shows some other buffer - or | 6380 | such window may be live---in which case it shows some other buffer---or |
| 6381 | dead at the time one of these functions is called. Usually, | 6381 | dead at the time one of these functions is called. Usually, |
| 6382 | @code{set-window-configuration} leaves the window alone if it is live | 6382 | @code{set-window-configuration} leaves the window alone if it is live |
| 6383 | while @code{window-state-put} deletes it. | 6383 | while @code{window-state-put} deletes it. |
| @@ -6399,14 +6399,15 @@ This means to try to delete the window if and only if it is dedicated to | |||
| 6399 | its buffer. | 6399 | its buffer. |
| 6400 | 6400 | ||
| 6401 | @item @code{nil} | 6401 | @item @code{nil} |
| 6402 | This is the default and means that @code{set-window-configuration} will | 6402 | This is the default, and it means that @code{set-window-configuration} |
| 6403 | try to delete the window if and only if it is dedicated to its buffer | 6403 | will try to delete the window if and only if it is dedicated to its |
| 6404 | and @code{window-state-put} will unconditionally try to delete it. | 6404 | buffer, and @code{window-state-put} will unconditionally try to delete |
| 6405 | it. | ||
| 6405 | 6406 | ||
| 6406 | @item a function | 6407 | @item a function |
| 6407 | This means to restore the window, show some other buffer in it and add | 6408 | This means to restore the window and show some other buffer in it, like |
| 6408 | an entry for that window to a list that will be later passed as argument | 6409 | if the value is @code{t}, and also add an entry for that window to a |
| 6409 | to that function. | 6410 | list that will be later passed as the second argument to that function. |
| 6410 | @end table | 6411 | @end table |
| 6411 | 6412 | ||
| 6412 | If a window cannot be deleted (typically, because it is the last window | 6413 | If a window cannot be deleted (typically, because it is the last window |
| @@ -6417,21 +6418,23 @@ If the value of this variable is a function, that function should take | |||
| 6417 | three arguments. The first argument specifies the frame whose windows | 6418 | three arguments. The first argument specifies the frame whose windows |
| 6418 | have been restored. The third argument is either the constant | 6419 | have been restored. The third argument is either the constant |
| 6419 | @code{configuration} if the windows are restored by | 6420 | @code{configuration} if the windows are restored by |
| 6420 | @code{set-window-configuration} or the constant @code{state} if the | 6421 | @code{set-window-configuration}, or the constant @code{state} if the |
| 6421 | windows are restored by @code{window-state-put}. | 6422 | windows are restored by @code{window-state-put}. |
| 6422 | 6423 | ||
| 6423 | The second argument specifies a list of entries for @emph{any} window | 6424 | The second argument specifies a list of entries for @emph{all} windows |
| 6424 | whose previous buffer has been encountered dead at the time | 6425 | whose previous buffers have been found dead at the time |
| 6425 | @code{set-window-configuration} or @code{window-state-put} tried to | 6426 | @code{set-window-configuration} or @code{window-state-put} tried to |
| 6426 | restore it in that window (minibuffer windows are excluded). This means | 6427 | restore it in that window (minibuffer windows are excluded). This means |
| 6427 | that the function specified by this variable may also delete windows | 6428 | that the function may also delete windows which were found live by |
| 6428 | encountered live by @code{set-window-configuration}. | 6429 | @code{set-window-configuration}. |
| 6429 | 6430 | ||
| 6430 | Each entry is a list of six values - the window whose buffer was found | 6431 | Each entry in the list that is passed as the second argument to the |
| 6431 | dead, the dead buffer or its name, the positions of start and point of | 6432 | function is itself a list of six values: the window whose buffer was |
| 6432 | the buffer in that window, the dedicated status of the window as | 6433 | found dead, the dead buffer or its name, the positions of window-start |
| 6434 | (@pxref{Window Start and End}) and window-point (@pxref{Window Point}) | ||
| 6435 | of the buffer in that window, the dedicated state of the window as | ||
| 6433 | previously reported by @code{window-dedicated-p} and a flag that is | 6436 | previously reported by @code{window-dedicated-p} and a flag that is |
| 6434 | @code{t} if the window has been encountered live by | 6437 | @code{t} if the window has been found to be alive by |
| 6435 | @code{set-window-configuration} and @code{nil} otherwise. | 6438 | @code{set-window-configuration} and @code{nil} otherwise. |
| 6436 | @end defvar | 6439 | @end defvar |
| 6437 | 6440 | ||
| @@ -287,7 +287,7 @@ selected or deselected at the end of executing the current command. | |||
| 287 | *** New variable 'window-restore-killed-buffer-windows'. | 287 | *** New variable 'window-restore-killed-buffer-windows'. |
| 288 | It specifies how 'set-window-configuration' and 'window-state-put' | 288 | It specifies how 'set-window-configuration' and 'window-state-put' |
| 289 | should proceed with windows whose buffer was killed after the | 289 | should proceed with windows whose buffer was killed after the |
| 290 | corresponding configuration or state was made. | 290 | corresponding configuration or state was recorded. |
| 291 | 291 | ||
| 292 | ** Tab Bars and Tab Lines | 292 | ** Tab Bars and Tab Lines |
| 293 | 293 | ||
| @@ -1812,6 +1812,10 @@ styles to skip eager fontification of completion candidates, which | |||
| 1812 | improves performance. Such a Lisp program can then use the | 1812 | improves performance. Such a Lisp program can then use the |
| 1813 | 'completion-lazy-hilit' function to fontify candidates just in time. | 1813 | 'completion-lazy-hilit' function to fontify candidates just in time. |
| 1814 | 1814 | ||
| 1815 | ** New primitive 'buffer-last-name'. | ||
| 1816 | It returns the name of a buffer before the last time it was renamed or | ||
| 1817 | killed. | ||
| 1818 | |||
| 1815 | ** Functions and variables to transpose sexps | 1819 | ** Functions and variables to transpose sexps |
| 1816 | 1820 | ||
| 1817 | +++ | 1821 | +++ |
diff --git a/src/window.c b/src/window.c index 928c4ae02a8..2c002418605 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -8675,30 +8675,32 @@ call is performed with the frame temporarily selected. */); | |||
| 8675 | doc: /* Control restoring windows whose buffer was killed. | 8675 | doc: /* Control restoring windows whose buffer was killed. |
| 8676 | This variable specifies how the functions `set-window-configuration' and | 8676 | This variable specifies how the functions `set-window-configuration' and |
| 8677 | `window-state-put' shall handle a window whose buffer has been killed | 8677 | `window-state-put' shall handle a window whose buffer has been killed |
| 8678 | since the corresponding configuration or state was made. Any such | 8678 | since the corresponding configuration or state was recorded. Any such |
| 8679 | window may be live - in which case it shows some other buffer - or dead | 8679 | window may be live -- in which case it shows some other buffer -- or |
| 8680 | at the time one of these functions is called. | 8680 | dead at the time one of these functions is called. |
| 8681 | 8681 | ||
| 8682 | As a rule, `set-window-configuration' leaves the window alone if it is | 8682 | By default, `set-window-configuration' leaves the window alone if it is |
| 8683 | live while `window-state-put' deletes it. The following values can be | 8683 | live, while `window-state-put' deletes it. The following values can be |
| 8684 | used to override the default behavior for dead windows in the case of | 8684 | used to override the default behavior for dead windows in the case of |
| 8685 | `set-window-configuration' and for dead and live windows in the case of | 8685 | `set-window-configuration' and for dead and live windows in the case of |
| 8686 | `window-state-put'. | 8686 | `window-state-put'. |
| 8687 | 8687 | ||
| 8688 | - t means to restore the window and show some other buffer in it. | 8688 | - t means to restore the window and show some other buffer in it. |
| 8689 | 8689 | ||
| 8690 | - `delete' means to try to delete the window. | 8690 | - `delete' means to try to delete the window. |
| 8691 | 8691 | ||
| 8692 | - `dedicated' means to try to delete the window if and only if it is | 8692 | - `dedicated' means to try to delete the window if and only if it is |
| 8693 | dedicated to its buffer. | 8693 | dedicated to its buffer. |
| 8694 | 8694 | ||
| 8695 | - nil, the default, means that `set-window-configuration' will try to | 8695 | - nil, the default, which means that `set-window-configuration' will |
| 8696 | delete the window if and only if it is dedicated to its buffer while | 8696 | try to delete the window if and only if it is dedicated to its |
| 8697 | `window-state-put' will unconditionally try to delete it. | 8697 | buffer while `window-state-put' will unconditionally try to delete |
| 8698 | it. | ||
| 8698 | 8699 | ||
| 8699 | - a function means to restore the window, show some other buffer in it | 8700 | - a function means to restore the window and show some other buffer in |
| 8700 | and add an entry for that window to a list that will be later passed | 8701 | it, like if the value were t, but also to add an entry for that |
| 8701 | as argument to that function. | 8702 | window to a list that will be later passed as argument to that |
| 8703 | function. | ||
| 8702 | 8704 | ||
| 8703 | If a window cannot be deleted (typically, because it is the last window | 8705 | If a window cannot be deleted (typically, because it is the last window |
| 8704 | on its frame), show another buffer in it. | 8706 | on its frame), show another buffer in it. |
| @@ -8709,19 +8711,19 @@ third argument is the constant `configuration' if the windows are | |||
| 8709 | restored by `set-window-configuration' and the constant `state' if the | 8711 | restored by `set-window-configuration' and the constant `state' if the |
| 8710 | windows are restored by `window-state-put'. | 8712 | windows are restored by `window-state-put'. |
| 8711 | 8713 | ||
| 8712 | The second argument specifies a list of entries for @emph{any} window | 8714 | The second argument specifies a list of entries for all windows |
| 8713 | whose previous buffer has been encountered dead at the time | 8715 | whose previous buffers have been found dead at the time |
| 8714 | `set-window-configuration' or `window-state-put' tried to restore it in | 8716 | `set-window-configuration' or `window-state-put' tried to restore it in |
| 8715 | that window (minibuffer windows are excluded). This means that the | 8717 | that window (minibuffer windows are excluded). This means that the |
| 8716 | function specified by this variable may also delete windows encountered | 8718 | function specified by this variable may also delete windows which were |
| 8717 | live by `set-window-configuration'. | 8719 | found to be alive by `set-window-configuration'. |
| 8718 | 8720 | ||
| 8719 | Each entry is a list of six values - the window whose buffer was found | 8721 | Each entry is a list of six values: the window whose buffer was found |
| 8720 | dead, the dead buffer or its name, the positions of start and point of | 8722 | dead, the dead buffer or its name, the positions of window-start and |
| 8721 | the buffer in that window, the dedicated status of the window as | 8723 | window-point of the buffer in that window, the dedicated state of the |
| 8722 | reported by `window-dedicated-p' and a boolean - t if the window was | 8724 | window as reported by `window-dedicated-p', and a boolean -- t if the |
| 8723 | live when `set-window-configuration' tried to restore it and nil | 8725 | window was live when `set-window-configuration' tried to restore it, |
| 8724 | otherwise. */); | 8726 | and nil otherwise. */); |
| 8725 | window_restore_killed_buffer_windows = Qnil; | 8727 | window_restore_killed_buffer_windows = Qnil; |
| 8726 | 8728 | ||
| 8727 | DEFVAR_LISP ("recenter-redisplay", Vrecenter_redisplay, | 8729 | DEFVAR_LISP ("recenter-redisplay", Vrecenter_redisplay, |