]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't replace user input when completion prefix is empty (Bug#18951)
authorNoam Postavsky <npostavs@gmail.com>
Sun, 5 Nov 2017 16:36:20 +0000 (11:36 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Sun, 5 Nov 2017 16:36:20 +0000 (11:36 -0500)
* lisp/pcomplete.el (pcomplete-parse-arguments): Only replace user
input if we produced a non-empty common completion stub.

lisp/pcomplete.el

index 745a813b7585e9d310e210494f41c5f731630fc8..2d2a8773bfeaa5179fc89eaba08fb86154d1c386 100644 (file)
@@ -772,7 +772,7 @@ this is `comint-dynamic-complete-functions'."
                (setq c (cdr c)))
              (setq pcomplete-stub (substring common-stub 0 len)
                    pcomplete-autolist t)
-             (when (and begin (not pcomplete-show-list))
+             (when (and begin (> len 0) (not pcomplete-show-list))
                (delete-region begin (point))
                (pcomplete-insert-entry "" pcomplete-stub))
              (throw 'pcomplete-completions completions))