Commit 291e2b93 authored by Dan Davison's avatar Dan Davison Committed by Fabián Ezequiel Gallina
Browse files

Dismiss completions buffer when unique completion has been made

parent 9399498e
......@@ -1611,6 +1611,8 @@ and use the following as the value of this variable:
:group 'python
:safe 'stringp)
(defvar python-completion-original-window-configuration nil)
(defun python-shell-completion--get-completions (input process completion-code)
"Retrieve available completions for INPUT using PROCESS.
Argument COMPLETION-CODE is the python code used to get
......@@ -1638,7 +1640,12 @@ completions on the current context."
(completion (when completions
(try-completion input completions))))
(cond ((eq completion t)
(if (eq this-command last-command)
(when python-completion-original-window-configuration
(setq python-completion-original-window-configuration nil)
((null completion)
(message "Can't find completion for \"%s\"" input)
......@@ -1648,6 +1655,9 @@ completions on the current context."
(insert completion)
(unless python-completion-original-window-configuration
(setq python-completion-original-window-configuration
(with-output-to-temp-buffer "*Python Completions*"
(all-completions input completions)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment