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

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

bug#32850: 27.0.50; window-swap-states doesn't swap window prev/next-buf


From: Juri Linkov
Subject: bug#32850: 27.0.50; window-swap-states doesn't swap window prev/next-buffers
Date: Sun, 28 Oct 2018 21:09:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> @@ -5552,9 +5552,14 @@ window--state-get-1
>>       (buffer (window-buffer window))
>>       (selected (eq window (selected-window)))
>>       (next-buffers (when (window-live-p window)
>> -                     (window-next-buffers window)))
>> +                     (delq nil (mapcar (lambda (buffer)
>> +                                             (and (buffer-live-p buffer) 
>> buffer))
>> +                                           (window-next-buffers window)))))
>>       (prev-buffers (when (window-live-p window)
>> -                     (window-prev-buffers window)))
>> +                     (delq nil (mapcar (lambda (entry)
>> +                                             (and (buffer-live-p (nth 0 
>> entry))
>> +                                                  entry))
>> +                                           (window-prev-buffers window)))))
>>       (head
>>        `(,type
>>               ,@(unless (window-next-sibling window) `((last . t)))
>
> OK.  Wouldn't 'window-state-put' run into a similar problem when a
> buffer in some prev or next list gets killed in between getting and
> putting?

'window-state-put' already checks for 'buffer-live-p', and checking for nil
is not needed in 'window-state-put' after the patch above will protect
against nil getting into the window state.





reply via email to

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