From 9a5fc059730c7c28808b8ead58c8b1d370670a8d Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 17 May 2012 00:03:30 -0300 Subject: [PATCH] Don't request completions for zero-length input Fixes a bug in which incorrect completion output was displayed, for example when point was after a closing paren. --- lisp/progmodes/python.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f75b5cb51ae..47bdef2c928 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1633,8 +1633,9 @@ completions on the current context." (string-match "^\\(from\\|import\\)[ \t]" line)) (python-shell-completion--get-completions line process python-shell-module-completion-string-code) - (python-shell-completion--get-completions - input process python-shell-completion-string-code))) + (and (> (length input) 0) + (python-shell-completion--get-completions + input process python-shell-completion-string-code)))) (completion (when completions (try-completion input completions)))) (cond ((eq completion t) -- 2.39.5