]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't request completions for zero-length input
authorDan Davison <dandavison7@gmail.com>
Thu, 17 May 2012 03:03:30 +0000 (00:03 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Thu, 17 May 2012 03:03:30 +0000 (00:03 -0300)
Fixes a bug in which incorrect completion output was displayed, for
example when point was after a closing paren.

lisp/progmodes/python.el

index f75b5cb51ae12084150ef631d35c9f9492f99213..47bdef2c9285033ac9ab4e798c718edf5b1bf4b9 100644 (file)
@@ -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)