don't try to switch to it.
;; Make sure we have a completions window.
(or (get-buffer-window "*Completions*")
(minibuffer-completion-help))
- (select-window (get-buffer-window "*Completions*"))
- (goto-char (point-min))
- (search-forward "\n\n")
- (forward-line 1))
+ (let ((window (get-buffer-window "*Completions*")))
+ (when window
+ (select-window window)
+ (goto-char (point-min))
+ (search-forward "\n\n")
+ (forward-line 1))))
\f
;; Support keyboard commands to turn on various modifiers.