From fdbd7c4d622a9b16f5411ac52bad2e99cf91394e Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sun, 18 Jan 1998 03:32:20 +0000 Subject: [PATCH] (switch-to-completions): If no completions window, don't try to switch to it. --- lisp/simple.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index fcb53009dff..944f8e9e0e0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3609,10 +3609,12 @@ select the completion near point.\n\n")) ;; 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)))) ;; Support keyboard commands to turn on various modifiers. -- 2.39.2