From: Noam Postavsky Date: Sun, 5 Nov 2017 16:36:20 +0000 (-0500) Subject: Don't replace user input when completion prefix is empty (Bug#18951) X-Git-Tag: emacs-26.0.91~370 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5d744e032fee9ce60446a3cc0cf7c2e681ace465;p=emacs.git Don't replace user input when completion prefix is empty (Bug#18951) * lisp/pcomplete.el (pcomplete-parse-arguments): Only replace user input if we produced a non-empty common completion stub. --- diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 745a813b758..2d2a8773bfe 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -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))