bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#46904: Non-unique windows produced by window-state-put


From: Juri Linkov
Subject: bug#46904: Non-unique windows produced by window-state-put
Date: Thu, 04 Mar 2021 22:31:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> I'd first try a vertical, then a horizontal split.  Give up if both
>> fail.
>
> Maybe something like this:
>
> @@ -6229,10 +6229,15 @@ window-state-put
> +  ;; Create a new window to replace the existing one.
> +  (let ((new-window
> +         (or (ignore-errors (split-window (selected-window)))
> +             (ignore-errors (split-window (selected-window) nil t)))))
> +    (when new-window
> +      (delete-window window)
> +      (setq window new-window)))

Actually with this patch window-swap-states fails with the error
"Wrong type argument: stringp, nil" in:

      ;; Swap basic states.
      (window-state-put state-1 window-2 t)
      (window-state-put state-2 window-1 t)
      ;; Swap overlays with `window' property.
      (with-current-buffer (window-buffer window-1)

Here '(window-buffer window-1)' returns nil because
window-1 doesn't exist anymore after calling window-state-put.





reply via email to

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