Subject: bug#32777: 27.0.50; window-buffer gets wrong point

From: Juri Linkov <[email-masked]>
Date: Thu, 20 Sep 2018 01:55:01 +0300

This bug report concerns one particular usage of window-buffer in
read-extended-command, but the same issue might exist in other places:

0. emacs -Q

1. copy to *scratch* as text:

next-error
nonexistent-command

2.

2.1. put point on "next-error", type M-x M-n,
     it correctly inserts "next-error" to the minibuffer

2.2. put point on "nonexistent-command", type M-x M-n,
     it correctly displays "End of history; no default available"

3.

3.1. put point on "nonexistent-command"

3.2. split window C-x 2 or C-x 3 and switch to another window C-x o

3.3. put point on "next-error", type M-x M-n,
     it correctly inserts "next-error" to the minibuffer

4.

4.1. delete-other-windows with C-x 1

4.1. put point on "nonexistent-command"

4.2. create new frame with C-x 5 2

4.3. put point on "next-error", type M-x M-n,
     it displays "End of history; no default available",
     this is wrong