[Top][All Lists]

[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: Thu, 25 Oct 2018 22:31:20 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> I found a problem, it occurs very rarely:
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>    get-buffer(nil)
>>    #f(compiled-function (entry) #<bytecode 0x22c739>)((nil nil nil))
>>    mapcar(#f(compiled-function (entry) #<bytecode 0x22c739>) (("*Group*" 1 
>> 139) (nil nil nil) ("*sent reply to martin rudalics*" 1 1090)))
>>    window--state-put-2(safe 737)
>>    window-state-put(...)
>> Do you have an idea how did (nil nil nil) find its way into the list of
>> prev-buffers?  (window-state-get was used with the non-nil WRITABLE arg)
> The most simple way to find out is to define such a list in window.c
> and have 'set-window-prev-buffers' holler if the prev_buffers argument
> is equal to that list.

I can't find out how '(nil nil nil)' gets into the prev-buffers,
so to avoid the error, I propose to install this patch:

diff --git a/lisp/window.el b/lisp/window.el
index 27d7e42280..c562ed3cfa 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5854,14 +5854,15 @@ window--state-put-2
                    (delq nil (mapcar (lambda (buffer)
-                                       (setq buffer (get-buffer buffer))
+                                       (setq buffer (and buffer (get-buffer 
                                        (when (buffer-live-p buffer) buffer))
                 (when prev-buffers
                    (delq nil (mapcar (lambda (entry)
-                                       (let ((buffer (get-buffer (nth 0 
+                                       (let ((buffer (and (nth 0 entry)
+                                                          (get-buffer (nth 0 
                                              (m1 (nth 1 entry))
                                              (m2 (nth 2 entry)))
                                          (when (buffer-live-p buffer)

reply via email to

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