From: Karl Heuer Date: Sun, 18 Jan 1998 03:32:20 +0000 (+0000) Subject: (switch-to-completions): If no completions window, X-Git-Tag: emacs-20.3~2411 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fdbd7c4d622a9b16f5411ac52bad2e99cf91394e;p=emacs.git (switch-to-completions): If no completions window, don't try to switch to it. --- 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.