Subject: bug#18951: eshell-pcomplete removes asterisk when attempting completion

From: Noam Postavsky <[email-masked]>
Date: Sun, 05 Nov 2017 12:17:27 -0500

tags 18951 fixed
close 18951 26.1
quit

Dmitry Gutov <[email-masked]> writes:

> On 11/2/17 4:15 PM, Daniel Kraus wrote:

>>> --- i/lisp/pcomplete.el
>>> +++ w/lisp/pcomplete.el
>>> @@ -772,7 +772,7 @@ pcomplete-parse-arguments
>>>   		(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))
>>
>> I didn't test it too much if something else breaks but it
>> seems to work. pcomplete doesn't remove the * and company
>> mode also seems to work without problems now.
>
> Looking good in my testing, and fixes the problem. Thanks!
> pcomplete-completion-at-point is still buggy, of course, but no worse
> than before.

Okay, pushed to emacs-26.

[1: 5d744e032f]: 2017-11-05 11:36:20 -0500
  Don't replace user input when completion prefix is empty (Bug#18951)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=5d744e032fee9ce60446a3cc0cf7c2e681ace465>