diff options
| author | Michael Albinus | 2024-10-11 12:07:03 +0200 |
|---|---|---|
| committer | Michael Albinus | 2024-10-11 12:07:03 +0200 |
| commit | e44f98b71bfd1f93d9b443a34e01a523ec34d3bb (patch) | |
| tree | 41ae3c51b0276d20c442a5e116a94620920f20f7 | |
| parent | 8032423239ae2df6970c208a1b0166dcda65a445 (diff) | |
| parent | 3462b2b9d0ca6a483d5c3200ef71a8ca243225d1 (diff) | |
| download | emacs-e44f98b71bfd1f93d9b443a34e01a523ec34d3bb.tar.gz emacs-e44f98b71bfd1f93d9b443a34e01a523ec34d3bb.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
| -rw-r--r-- | doc/lispref/windows.texi | 57 | ||||
| -rw-r--r-- | lisp/erc/erc-speedbar.el | 3 | ||||
| -rw-r--r-- | lisp/window.el | 111 |
3 files changed, 97 insertions, 74 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index d9e99d9ca5c..0b8d7d3b76d 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -427,13 +427,14 @@ window @var{window}. The argument @var{direction} must be one of | |||
| 427 | argument @var{window} must denote a live window and defaults to the | 427 | argument @var{window} must denote a live window and defaults to the |
| 428 | selected one. | 428 | selected one. |
| 429 | 429 | ||
| 430 | This function does not return a window whose @code{no-other-window} | 430 | This function does not return a window for which |
| 431 | parameter is non-@code{nil} (@pxref{Window Parameters}). If the nearest | 431 | @code{window-no-other-p} (@pxref{Cyclic Window Ordering}) returns |
| 432 | window's @code{no-other-window} parameter is non-@code{nil}, this | 432 | non-@code{nil}. If the nearest window's @code{no-other-window} |
| 433 | function tries to find another window in the indicated direction whose | 433 | parameter is non-@code{nil}, this function tries to find another window |
| 434 | @code{no-other-window} parameter is @code{nil}. If the optional | 434 | in the indicated direction whose @code{no-other-window} parameter is |
| 435 | argument @var{ignore} is non-@code{nil}, a window may be returned even | 435 | @code{nil}. However, if the optional argument @var{ignore} is |
| 436 | if its @code{no-other-window} parameter is non-@code{nil}. | 436 | non-@code{nil}, a window may be returned even if its |
| 437 | @code{no-other-window} parameter is non-@code{nil}. | ||
| 437 | 438 | ||
| 438 | If the optional argument @var{sign} is a negative number, it means to | 439 | If the optional argument @var{sign} is a negative number, it means to |
| 439 | use the right or bottom edge of @var{window} as reference position | 440 | use the right or bottom edge of @var{window} as reference position |
| @@ -1585,9 +1586,10 @@ choose the first window (the window returned by | |||
| 1585 | @code{frame-first-window}) on that frame. | 1586 | @code{frame-first-window}) on that frame. |
| 1586 | @end itemize | 1587 | @end itemize |
| 1587 | 1588 | ||
| 1588 | A window with a non-@code{nil} @code{no-other-window} parameter is | 1589 | A window for which @code{window-no-other-p} (@pxref{Cyclic Window |
| 1589 | chosen only if all other windows on that frame have that parameter set | 1590 | Ordering}) returns non-@code{nil} is chosen only if all other windows on |
| 1590 | to a non-@code{nil} value too. | 1591 | that frame have their @code{no-other-window} parameter set to a |
| 1592 | non-@code{nil} value too. | ||
| 1591 | @end defopt | 1593 | @end defopt |
| 1592 | 1594 | ||
| 1593 | @deffn Command delete-other-windows &optional window | 1595 | @deffn Command delete-other-windows &optional window |
| @@ -2129,16 +2131,33 @@ The optional argument @var{all-frames} has the same meaning as in | |||
| 2129 | @code{next-window}, like a @code{nil} @var{minibuf} argument to | 2131 | @code{next-window}, like a @code{nil} @var{minibuf} argument to |
| 2130 | @code{next-window}. | 2132 | @code{next-window}. |
| 2131 | 2133 | ||
| 2132 | This function does not select a window that has a non-@code{nil} | ||
| 2133 | @code{no-other-window} window parameter (@pxref{Window Parameters}), | ||
| 2134 | provided that @code{ignore-window-parameters} is @code{nil}. | ||
| 2135 | |||
| 2136 | If the @code{other-window} parameter of the selected window is a | 2134 | If the @code{other-window} parameter of the selected window is a |
| 2137 | function, and @code{ignore-window-parameters} is @code{nil}, that | 2135 | function, and @code{ignore-window-parameters} is @code{nil}, that |
| 2138 | function will be called with the arguments @var{count} and | 2136 | function will be called with the arguments @var{count} and |
| 2139 | @var{all-frames} instead of the normal operation of this function. | 2137 | @var{all-frames} instead of the normal operation of this function. |
| 2138 | |||
| 2139 | Otherwise, this function does not select a window for which the function | ||
| 2140 | @code{window-no-other-p} (see next) returns @code{nil}. | ||
| 2140 | @end deffn | 2141 | @end deffn |
| 2141 | 2142 | ||
| 2143 | @defun window-no-other-p &optional window | ||
| 2144 | This function returns non-@code{nil} if @var{window} should not be used | ||
| 2145 | as ``other'' window by commands like @code{other-window} or functions | ||
| 2146 | like @code{get-lru-window} (see below). It's also called when deleting | ||
| 2147 | the selected window (@pxref{Deleting Windows}) and a new selected window | ||
| 2148 | has to be chosen. | ||
| 2149 | |||
| 2150 | More precisely, this function returns non-@code{nil} if the | ||
| 2151 | @code{no-other-window} parameter of @var{window} is non-@code{nil} and | ||
| 2152 | @code{ignore-window-parameters} is @code{nil}. It returns @code{nil} in | ||
| 2153 | any other case. | ||
| 2154 | |||
| 2155 | Note that if this function returns @code{nil}, this does not necessarily | ||
| 2156 | mean that @var{window} can be selected. A tooltip window (@pxref{Basic | ||
| 2157 | Windows}), for example, has its @code{no-other-window} parameter set to | ||
| 2158 | @code{t} by default but cannot be selected. | ||
| 2159 | @end defun | ||
| 2160 | |||
| 2142 | @defun walk-windows fun &optional minibuf all-frames | 2161 | @defun walk-windows fun &optional minibuf all-frames |
| 2143 | This function calls the function @var{fun} once for each live window, | 2162 | This function calls the function @var{fun} once for each live window, |
| 2144 | with the window as the argument. | 2163 | with the window as the argument. |
| @@ -2186,8 +2205,9 @@ optional argument @var{dedicated} is non-@code{nil}. The selected | |||
| 2186 | window is never returned, unless it is the only candidate. However, if | 2205 | window is never returned, unless it is the only candidate. However, if |
| 2187 | the optional argument @var{not-selected} is non-@code{nil}, this | 2206 | the optional argument @var{not-selected} is non-@code{nil}, this |
| 2188 | function returns @code{nil} in that case. The optional argument | 2207 | function returns @code{nil} in that case. The optional argument |
| 2189 | @var{no-other}, if non-@code{nil}, means to never return a window whose | 2208 | @var{no-other}, if non-@code{nil}, means to never return a window for |
| 2190 | @code{no-other-window} parameter is non-@code{nil}. | 2209 | which @code{window-no-other-p} (@pxref{Cyclic Window Ordering}) returns |
| 2210 | non-@code{nil}. | ||
| 2191 | @end defun | 2211 | @end defun |
| 2192 | 2212 | ||
| 2193 | @cindex most recently used window | 2213 | @cindex most recently used window |
| @@ -6784,7 +6804,10 @@ This parameter affects the execution of @code{other-window} | |||
| 6784 | @item no-other-window | 6804 | @item no-other-window |
| 6785 | @vindex no-other-window@r{, a window parameter} | 6805 | @vindex no-other-window@r{, a window parameter} |
| 6786 | This parameter marks the window as not selectable by @code{other-window} | 6806 | This parameter marks the window as not selectable by @code{other-window} |
| 6787 | (@pxref{Cyclic Window Ordering}). | 6807 | (@pxref{Cyclic Window Ordering}). It is by default @code{t} for tooltip |
| 6808 | windows (@pxref{Basic Windows}). Use @code{window-no-other-p} | ||
| 6809 | (@pxref{Cyclic Window Ordering}) to check whether it applies to a | ||
| 6810 | specific window. | ||
| 6788 | 6811 | ||
| 6789 | @item clone-of | 6812 | @item clone-of |
| 6790 | @vindex clone-of@r{, a window parameter} | 6813 | @vindex clone-of@r{, a window parameter} |
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index e45fb9a7adf..a281e13734c 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el | |||
| @@ -652,8 +652,7 @@ unlock the window." | |||
| 652 | (when-let ((window (get-buffer-window speedbar-buffer))) | 652 | (when-let ((window (get-buffer-window speedbar-buffer))) |
| 653 | (let ((val (cond ((natnump arg) t) | 653 | (let ((val (cond ((natnump arg) t) |
| 654 | ((integerp arg) nil) | 654 | ((integerp arg) nil) |
| 655 | (t (not (window-parameter window | 655 | (t (not (window-no-other-p window)))))) |
| 656 | 'no-other-window)))))) | ||
| 657 | (with-current-buffer speedbar-buffer | 656 | (with-current-buffer speedbar-buffer |
| 658 | (setq cursor-type (not val))) | 657 | (setq cursor-type (not val))) |
| 659 | (set-window-parameter window 'no-other-window val) | 658 | (set-window-parameter window 'no-other-window val) |
diff --git a/lisp/window.el b/lisp/window.el index 5822947f2fe..1b95b5c9500 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -428,6 +428,16 @@ The functions currently affected by this are `split-window', | |||
| 428 | An application may bind this to a non-nil value around calls to | 428 | An application may bind this to a non-nil value around calls to |
| 429 | these functions to inhibit processing of window parameters.") | 429 | these functions to inhibit processing of window parameters.") |
| 430 | 430 | ||
| 431 | (defun window-no-other-p (&optional window) | ||
| 432 | "Return non-nil if WINDOW should not be used as \"other\" window. | ||
| 433 | WINDOW must be a live window and defaults to the selected one. | ||
| 434 | |||
| 435 | Return non-nil if the `no-other-window' parameter of WINDOW is non-nil | ||
| 436 | and `ignore-window-parameters' is nil. Return nil in any other case." | ||
| 437 | (setq window (window-normalize-window window t)) | ||
| 438 | (and (not ignore-window-parameters) | ||
| 439 | (window-parameter window 'no-other-window))) | ||
| 440 | |||
| 431 | ;; This must go to C, finally (or get removed). | 441 | ;; This must go to C, finally (or get removed). |
| 432 | (defconst window-safe-min-height 1 | 442 | (defconst window-safe-min-height 1 |
| 433 | "The absolute minimum number of lines of any window. | 443 | "The absolute minimum number of lines of any window. |
| @@ -2307,11 +2317,11 @@ as seen from the position of `window-point' in window WINDOW. | |||
| 2307 | DIRECTION should be one of `above', `below', `left' or `right'. | 2317 | DIRECTION should be one of `above', `below', `left' or `right'. |
| 2308 | WINDOW must be a live window and defaults to the selected one. | 2318 | WINDOW must be a live window and defaults to the selected one. |
| 2309 | 2319 | ||
| 2310 | Do not return a window whose `no-other-window' parameter is | 2320 | Do not return a window for which `window-no-other-p' returns non-nil. |
| 2311 | non-nil. If the nearest window's `no-other-window' parameter is | 2321 | If `window-no-other-p' returns non-nil for the nearest window, try to |
| 2312 | non-nil, try to find another window in the indicated direction. | 2322 | find another window in the indicated direction. If, however, the |
| 2313 | If, however, the optional argument IGNORE is non-nil, return that | 2323 | optional argument IGNORE is non-nil, return the nearest window even if |
| 2314 | window even if its `no-other-window' parameter is non-nil. | 2324 | `window-no-other-p' returns for it a non-nil value. |
| 2315 | 2325 | ||
| 2316 | Optional argument SIGN a negative number means to use the right | 2326 | Optional argument SIGN a negative number means to use the right |
| 2317 | or bottom edge of WINDOW as reference position instead of | 2327 | or bottom edge of WINDOW as reference position instead of |
| @@ -2375,7 +2385,7 @@ Return nil if no suitable window can be found." | |||
| 2375 | (cond | 2385 | (cond |
| 2376 | ((or (eq window w) | 2386 | ((or (eq window w) |
| 2377 | ;; Ignore ourselves. | 2387 | ;; Ignore ourselves. |
| 2378 | (and (window-parameter w 'no-other-window) | 2388 | (and (window-no-other-p w) |
| 2379 | ;; Ignore W unless IGNORE is non-nil. | 2389 | ;; Ignore W unless IGNORE is non-nil. |
| 2380 | (not ignore)))) | 2390 | (not ignore)))) |
| 2381 | (hor | 2391 | (hor |
| @@ -2491,14 +2501,13 @@ and no others." | |||
| 2491 | 2501 | ||
| 2492 | (defun get-lru-window (&optional all-frames dedicated not-selected no-other) | 2502 | (defun get-lru-window (&optional all-frames dedicated not-selected no-other) |
| 2493 | "Return the least recently used window on frames specified by ALL-FRAMES. | 2503 | "Return the least recently used window on frames specified by ALL-FRAMES. |
| 2494 | Return a full-width window if possible. A minibuffer window is | 2504 | Return a full-width window if possible. A minibuffer window is never a |
| 2495 | never a candidate. A dedicated window is never a candidate | 2505 | candidate. A dedicated window is never a candidate unless DEDICATED is |
| 2496 | unless DEDICATED is non-nil, so if all windows are dedicated, the | 2506 | non-nil, so if all windows are dedicated, the value is nil. Avoid |
| 2497 | value is nil. Avoid returning the selected window if possible. | 2507 | returning the selected window if possible. Optional argument |
| 2498 | Optional argument NOT-SELECTED non-nil means never return the | 2508 | NOT-SELECTED non-nil means never return the selected window. Optional |
| 2499 | selected window. Optional argument NO-OTHER non-nil means to | 2509 | argument NO-OTHER non-nil means to never return a window for which |
| 2500 | never return a window whose `no-other-window' parameter is | 2510 | `window-no-other-p' returns non-nil. |
| 2501 | non-nil. | ||
| 2502 | 2511 | ||
| 2503 | The following non-nil values of the optional argument ALL-FRAMES | 2512 | The following non-nil values of the optional argument ALL-FRAMES |
| 2504 | have special meanings: | 2513 | have special meanings: |
| @@ -2522,8 +2531,7 @@ selected frame and no others." | |||
| 2522 | (dolist (window windows) | 2531 | (dolist (window windows) |
| 2523 | (when (and (or dedicated (not (window-dedicated-p window))) | 2532 | (when (and (or dedicated (not (window-dedicated-p window))) |
| 2524 | (or (not not-selected) (not (eq window (selected-window)))) | 2533 | (or (not not-selected) (not (eq window (selected-window)))) |
| 2525 | (or (not no-other) | 2534 | (or (not no-other) (not (window-no-other-p window)))) |
| 2526 | (not (window-parameter window 'no-other-window)))) | ||
| 2527 | (setq time (window-use-time window)) | 2535 | (setq time (window-use-time window)) |
| 2528 | (if (or (eq window (selected-window)) | 2536 | (if (or (eq window (selected-window)) |
| 2529 | (not (window-full-width-p window))) | 2537 | (not (window-full-width-p window))) |
| @@ -2537,12 +2545,11 @@ selected frame and no others." | |||
| 2537 | 2545 | ||
| 2538 | (defun get-mru-window (&optional all-frames dedicated not-selected no-other) | 2546 | (defun get-mru-window (&optional all-frames dedicated not-selected no-other) |
| 2539 | "Return the most recently used window on frames specified by ALL-FRAMES. | 2547 | "Return the most recently used window on frames specified by ALL-FRAMES. |
| 2540 | A minibuffer window is never a candidate. A dedicated window is | 2548 | A minibuffer window is never a candidate. A dedicated window is never a |
| 2541 | never a candidate unless DEDICATED is non-nil, so if all windows | 2549 | candidate unless DEDICATED is non-nil, so if all windows are dedicated, |
| 2542 | are dedicated, the value is nil. Optional argument NOT-SELECTED | 2550 | the value is nil. Optional argument NOT-SELECTED non-nil means never |
| 2543 | non-nil means never return the selected window. Optional | 2551 | return the selected window. Optional argument NO-OTHER non-nil means to |
| 2544 | argument NO-OTHER non-nil means to never return a window whose | 2552 | never return a window for which `window-no-other-p' returns non-nil. |
| 2545 | `no-other-window' parameter is non-nil. | ||
| 2546 | 2553 | ||
| 2547 | The following non-nil values of the optional argument ALL-FRAMES | 2554 | The following non-nil values of the optional argument ALL-FRAMES |
| 2548 | have special meanings: | 2555 | have special meanings: |
| @@ -2564,8 +2571,7 @@ selected frame and no others." | |||
| 2564 | (setq time (window-use-time window)) | 2571 | (setq time (window-use-time window)) |
| 2565 | (when (and (or dedicated (not (window-dedicated-p window))) | 2572 | (when (and (or dedicated (not (window-dedicated-p window))) |
| 2566 | (or (not not-selected) (not (eq window (selected-window)))) | 2573 | (or (not not-selected) (not (eq window (selected-window)))) |
| 2567 | (or (not no-other) | 2574 | (or (not no-other) (not (window-no-other-p window))) |
| 2568 | (not (window-parameter window 'no-other-window))) | ||
| 2569 | (or (not best-time) (> time best-time))) | 2575 | (or (not best-time) (> time best-time))) |
| 2570 | (setq best-time time) | 2576 | (setq best-time time) |
| 2571 | (setq best-window window))) | 2577 | (setq best-window window))) |
| @@ -2573,12 +2579,11 @@ selected frame and no others." | |||
| 2573 | 2579 | ||
| 2574 | (defun get-largest-window (&optional all-frames dedicated not-selected no-other) | 2580 | (defun get-largest-window (&optional all-frames dedicated not-selected no-other) |
| 2575 | "Return the largest window on frames specified by ALL-FRAMES. | 2581 | "Return the largest window on frames specified by ALL-FRAMES. |
| 2576 | A minibuffer window is never a candidate. A dedicated window is | 2582 | A minibuffer window is never a candidate. A dedicated window is never a |
| 2577 | never a candidate unless DEDICATED is non-nil, so if all windows | 2583 | candidate unless DEDICATED is non-nil, so if all windows are dedicated, |
| 2578 | are dedicated, the value is nil. Optional argument NOT-SELECTED | 2584 | the value is nil. Optional argument NOT-SELECTED non-nil means never |
| 2579 | non-nil means never return the selected window. Optional | 2585 | return the selected window. Optional argument NO-OTHER non-nil means to |
| 2580 | argument NO-OTHER non-nil means to never return a window whose | 2586 | never return a window for which `window-no-other-p' returns non-nil. |
| 2581 | `no-other-window' parameter is non-nil. | ||
| 2582 | 2587 | ||
| 2583 | The following non-nil values of the optional argument ALL-FRAMES | 2588 | The following non-nil values of the optional argument ALL-FRAMES |
| 2584 | have special meanings: | 2589 | have special meanings: |
| @@ -2602,8 +2607,7 @@ selected frame and no others." | |||
| 2602 | (dolist (window (window-list-1 nil 'nomini all-frames)) | 2607 | (dolist (window (window-list-1 nil 'nomini all-frames)) |
| 2603 | (when (and (or dedicated (not (window-dedicated-p window))) | 2608 | (when (and (or dedicated (not (window-dedicated-p window))) |
| 2604 | (or (not not-selected) (not (eq window (selected-window)))) | 2609 | (or (not not-selected) (not (eq window (selected-window)))) |
| 2605 | (or (not no-other) | 2610 | (or (not no-other) (window-no-other-p window))) |
| 2606 | (not (window-parameter window 'no-other-window)))) | ||
| 2607 | (setq size (* (window-pixel-height window) | 2611 | (setq size (* (window-pixel-height window) |
| 2608 | (window-pixel-width window))) | 2612 | (window-pixel-width window))) |
| 2609 | (when (> size best-size) | 2613 | (when (> size best-size) |
| @@ -3963,12 +3967,10 @@ skip -COUNT windows backwards. COUNT zero means do not skip any | |||
| 3963 | window, so select the selected window. In an interactive call, | 3967 | window, so select the selected window. In an interactive call, |
| 3964 | COUNT is the numeric prefix argument. Return nil. | 3968 | COUNT is the numeric prefix argument. Return nil. |
| 3965 | 3969 | ||
| 3966 | If the `other-window' parameter of the selected window is a | 3970 | If the `other-window' parameter of the selected window is a function and |
| 3967 | function and `ignore-window-parameters' is nil, call that | 3971 | `ignore-window-parameters' is nil, call that function with the arguments |
| 3968 | function with the arguments COUNT and ALL-FRAMES. | 3972 | COUNT and ALL-FRAMES. Otherwise, do not return a window for which |
| 3969 | 3973 | `window-no-other-p' returns non-nil. | |
| 3970 | This function does not select a window whose `no-other-window' | ||
| 3971 | window parameter is non-nil. | ||
| 3972 | 3974 | ||
| 3973 | This function uses `next-window' for finding the window to | 3975 | This function uses `next-window' for finding the window to |
| 3974 | select. The argument ALL-FRAMES has the same meaning as in | 3976 | select. The argument ALL-FRAMES has the same meaning as in |
| @@ -3994,7 +3996,7 @@ always effectively nil." | |||
| 3994 | ;; Keep out of infinite loops. When COUNT has not changed | 3996 | ;; Keep out of infinite loops. When COUNT has not changed |
| 3995 | ;; since we last looked at `window' we're probably in one. | 3997 | ;; since we last looked at `window' we're probably in one. |
| 3996 | (throw 'exit nil))) | 3998 | (throw 'exit nil))) |
| 3997 | ((window-parameter window 'no-other-window) | 3999 | ((window-no-other-p window) |
| 3998 | (unless old-window | 4000 | (unless old-window |
| 3999 | ;; The first non-selectable window `next-window' got us: | 4001 | ;; The first non-selectable window `next-window' got us: |
| 4000 | ;; Remember it and the current value of COUNT. | 4002 | ;; Remember it and the current value of COUNT. |
| @@ -4010,7 +4012,7 @@ always effectively nil." | |||
| 4010 | ;; Keep out of infinite loops. When COUNT has not changed | 4012 | ;; Keep out of infinite loops. When COUNT has not changed |
| 4011 | ;; since we last looked at `window' we're probably in one. | 4013 | ;; since we last looked at `window' we're probably in one. |
| 4012 | (throw 'exit nil))) | 4014 | (throw 'exit nil))) |
| 4013 | ((window-parameter window 'no-other-window) | 4015 | ((window-no-other-p window) |
| 4014 | (unless old-window | 4016 | (unless old-window |
| 4015 | ;; The first non-selectable window `previous-window' got | 4017 | ;; The first non-selectable window `previous-window' got |
| 4016 | ;; us: Remember it and the current value of COUNT. | 4018 | ;; us: Remember it and the current value of COUNT. |
| @@ -4183,10 +4185,10 @@ Tool-bar and tab-bar pseudo-windows are ignored by this function: | |||
| 4183 | if the specified coordinates are in any of these two windows, this | 4185 | if the specified coordinates are in any of these two windows, this |
| 4184 | function returns nil. | 4186 | function returns nil. |
| 4185 | 4187 | ||
| 4186 | Optional argument FRAME must specify a live frame and defaults to | 4188 | Optional argument FRAME must specify a live frame and defaults to the |
| 4187 | the selected one. Optional argument NO-OTHER non-nil means to | 4189 | selected one. Optional argument NO-OTHER non-nil means to return nil if |
| 4188 | return nil if the window located at the specified coordinates has | 4190 | `window-no-other-p' returns non-nil for the window located at the |
| 4189 | a non-nil `no-other-window' parameter." | 4191 | specified coordinates." |
| 4190 | (setq frame (window-normalize-frame frame)) | 4192 | (setq frame (window-normalize-frame frame)) |
| 4191 | (let* ((root-edges (window-edges (frame-root-window frame) nil nil t)) | 4193 | (let* ((root-edges (window-edges (frame-root-window frame) nil nil t)) |
| 4192 | (root-left (nth 2 root-edges)) | 4194 | (root-left (nth 2 root-edges)) |
| @@ -4199,7 +4201,7 @@ a non-nil `no-other-window' parameter." | |||
| 4199 | (or (< x (nth 2 edges)) (= x root-left)) | 4201 | (or (< x (nth 2 edges)) (= x root-left)) |
| 4200 | (>= y (nth 1 edges)) | 4202 | (>= y (nth 1 edges)) |
| 4201 | (or (< y (nth 3 edges)) (= y root-bottom))) | 4203 | (or (< y (nth 3 edges)) (= y root-bottom))) |
| 4202 | (if (and no-other (window-parameter window 'no-other-window)) | 4204 | (if (and no-other (window-no-other-p window)) |
| 4203 | (throw 'window nil) | 4205 | (throw 'window nil) |
| 4204 | (throw 'window window))))) | 4206 | (throw 'window window))))) |
| 4205 | frame)))) | 4207 | frame)))) |
| @@ -4211,13 +4213,13 @@ another live window on that frame to serve as its selected | |||
| 4211 | window. This option controls the window that is selected in such | 4213 | window. This option controls the window that is selected in such |
| 4212 | a situation. | 4214 | a situation. |
| 4213 | 4215 | ||
| 4214 | The possible choices are `mru' (the default) to select the most | 4216 | The possible choices are `mru' (the default) to select the most recently |
| 4215 | recently used window on that frame, and `pos' to choose the | 4217 | used window on that frame, and `pos' to choose the window at the frame |
| 4216 | window at the frame coordinates of point of the previously | 4218 | coordinates of point of the previously selected window. If this is nil, |
| 4217 | selected window. If this is nil, choose the frame's first window | 4219 | choose the frame's first window instead. A window for which |
| 4218 | instead. A window with a non-nil `no-other-window' parameter is | 4220 | `window-no-other-p' returns non-nil is chosen only if all windows on |
| 4219 | chosen only if all windows on that frame have that parameter set | 4221 | that frame have their `no-other-window' parameter set to a non-nil |
| 4220 | to a non-nil value." | 4222 | value." |
| 4221 | :type '(choice (const :tag "Most recently used" mru) | 4223 | :type '(choice (const :tag "Most recently used" mru) |
| 4222 | (const :tag "At position of deleted" pos) | 4224 | (const :tag "At position of deleted" pos) |
| 4223 | (const :tag "Frame's first " nil)) | 4225 | (const :tag "Frame's first " nil)) |
| @@ -4340,15 +4342,14 @@ the option `delete-window-choose-selected'." | |||
| 4340 | (let ((mru-window (get-mru-window frame nil nil t))) | 4342 | (let ((mru-window (get-mru-window frame nil nil t))) |
| 4341 | (and mru-window | 4343 | (and mru-window |
| 4342 | (set-frame-selected-window frame mru-window))))) | 4344 | (set-frame-selected-window frame mru-window))))) |
| 4343 | ((and (window-parameter | 4345 | ((and (window-no-other-p (frame-selected-window frame)) |
| 4344 | (frame-selected-window frame) 'no-other-window) | ||
| 4345 | ;; If `delete-window-internal' selected a window with a | 4346 | ;; If `delete-window-internal' selected a window with a |
| 4346 | ;; non-nil 'no-other-window' parameter as its frame's | 4347 | ;; non-nil 'no-other-window' parameter as its frame's |
| 4347 | ;; selected window, try to choose another one. | 4348 | ;; selected window, try to choose another one. |
| 4348 | (catch 'found | 4349 | (catch 'found |
| 4349 | (walk-window-tree | 4350 | (walk-window-tree |
| 4350 | (lambda (other) | 4351 | (lambda (other) |
| 4351 | (unless (window-parameter other 'no-other-window) | 4352 | (unless (window-no-other-p other) |
| 4352 | (set-frame-selected-window frame other) | 4353 | (set-frame-selected-window frame other) |
| 4353 | (throw 'found t))) | 4354 | (throw 'found t))) |
| 4354 | frame)))) | 4355 | frame)))) |