unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50576: 28.0.50; display-buffer-in-previous-window no longer accepts window value for previous-window
@ 2021-09-14  0:43 Adam Porter
  2021-09-14  6:35 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Porter @ 2021-09-14  0:43 UTC (permalink / raw)
  To: 50576

Hi Juri, et al,

It seems the patch in this message:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45688#116

which was installed causes the function
display-buffer-in-previous-window to fail when called with an alist
having the previous-window key set to a window value, because it calls
boundp on the value unconditionally rather than checking the type of
the value.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#50576: 28.0.50; display-buffer-in-previous-window no longer accepts window value for previous-window
  2021-09-14  0:43 bug#50576: 28.0.50; display-buffer-in-previous-window no longer accepts window value for previous-window Adam Porter
@ 2021-09-14  6:35 ` Juri Linkov
  2021-09-14 13:37   ` Adam Porter
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-09-14  6:35 UTC (permalink / raw)
  To: Adam Porter; +Cc: 50576

> It seems the patch in this message:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45688#116
>
> which was installed causes the function
> display-buffer-in-previous-window to fail when called with an alist
> having the previous-window key set to a window value, because it calls
> boundp on the value unconditionally rather than checking the type of
> the value.

Sorry, this was a wrong assumption.  Does this patch correctly fix it?

diff --git a/lisp/window.el b/lisp/window.el
index 2960384e15..1c795cf684 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8363,7 +8363,7 @@ display-buffer-in-previous-window
 	    (throw 'best t)))))
     ;; When ALIST has a `previous-window' entry, that entry may override
     ;; anything we found so far.
-    (when (and previous-window (boundp previous-window))
+    (when (and previous-window (symbolp previous-window) (boundp previous-window))
       (setq previous-window (symbol-value previous-window)))
     (when (and (setq window previous-window)
 	       (window-live-p window)





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#50576: 28.0.50; display-buffer-in-previous-window no longer accepts window value for previous-window
  2021-09-14  6:35 ` Juri Linkov
@ 2021-09-14 13:37   ` Adam Porter
  2021-09-15  6:48     ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Porter @ 2021-09-14 13:37 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 50576

Hi Juri,

On Tue, Sep 14, 2021 at 1:44 AM Juri Linkov <juri@linkov.net> wrote:

> Sorry, this was a wrong assumption.  Does this patch correctly fix it?
>
> diff --git a/lisp/window.el b/lisp/window.el
> index 2960384e15..1c795cf684 100644
> --- a/lisp/window.el
> +++ b/lisp/window.el
> @@ -8363,7 +8363,7 @@ display-buffer-in-previous-window
>             (throw 'best t)))))
>      ;; When ALIST has a `previous-window' entry, that entry may override
>      ;; anything we found so far.
> -    (when (and previous-window (boundp previous-window))
> +    (when (and previous-window (symbolp previous-window) (boundp previous-window))
>        (setq previous-window (symbol-value previous-window)))
>      (when (and (setq window previous-window)
>                (window-live-p window)

Yes, that seems to work.  Thanks.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#50576: 28.0.50; display-buffer-in-previous-window no longer accepts window value for previous-window
  2021-09-14 13:37   ` Adam Porter
@ 2021-09-15  6:48     ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2021-09-15  6:48 UTC (permalink / raw)
  To: Adam Porter; +Cc: 50576

tags 50576 fixed
close 50576 28.0.50
thanks

>> Sorry, this was a wrong assumption.  Does this patch correctly fix it?
>>
>> diff --git a/lisp/window.el b/lisp/window.el
>> index 2960384e15..1c795cf684 100644
>> --- a/lisp/window.el
>> +++ b/lisp/window.el
>> @@ -8363,7 +8363,7 @@ display-buffer-in-previous-window
>>             (throw 'best t)))))
>>      ;; When ALIST has a `previous-window' entry, that entry may override
>>      ;; anything we found so far.
>> -    (when (and previous-window (boundp previous-window))
>> +    (when (and previous-window (symbolp previous-window) (boundp previous-window))
>>        (setq previous-window (symbol-value previous-window)))
>>      (when (and (setq window previous-window)
>>                (window-live-p window)
>
> Yes, that seems to work.  Thanks.

Thanks for the bug report.  Now fixed.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-15  6:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14  0:43 bug#50576: 28.0.50; display-buffer-in-previous-window no longer accepts window value for previous-window Adam Porter
2021-09-14  6:35 ` Juri Linkov
2021-09-14 13:37   ` Adam Porter
2021-09-15  6:48     ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).