Subject: 25.1; pop-to-buffer error: (wrong-type-argument window-live-p nil)

From: Leo Liu <[email-masked]>
Date: Tue, 30 Aug 2016 10:48:18 +0800

pop-to-buffer assumes display-buffer always return a window and
(select-window window norecord) but it can cause error like this (due to
(allow-no-window . t)):

Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
  select-window(nil nil)
  pop-to-buffer("*compile*" t nil)
  switch-to-buffer-other-window("*compile*")
  ido-visit-buffer("*compile*" other-window t)
  ido-buffer-internal(other-window switch-to-buffer-other-window)
  ido-switch-buffer-other-window()
  funcall-interactively(ido-switch-buffer-other-window)
  call-interactively(ido-switch-buffer-other-window nil nil)
  command-execute(ido-switch-buffer-other-window)