1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00

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.
This commit is contained in:
Noam Postavsky 2017-11-05 11:36:20 -05:00
parent ec6cf35c5f
commit 5d744e032f

View File

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