From 5d744e032fee9ce60446a3cc0cf7c2e681ace465 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 5 Nov 2017 11:36:20 -0500 Subject: 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. --- lisp/pcomplete.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/pcomplete.el') 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)) -- cgit v1.2.1