[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pcomplete.el (pcomplete-completions-at-point)] Why max?

From: Tadeus Prastowo
Subject: Re: [pcomplete.el (pcomplete-completions-at-point)] Why max?
Date: Tue, 19 Mar 2019 10:55:14 +0100

Hi everyone,

Does John still maintain the pcomplete package?

Best regards,

On Sat, Mar 16, 2019 at 11:29 PM Tadeus Prastowo
<address@hidden> wrote:
> Hi John,
> I am using Emacs at commit 4633b0e and see a problem that can be
> solved ad-hoc by using `min' instead of `max' in the following code
> within function `pcomplete-completions-at-point' in file
> `lisp/pcomplete.el':
>            (beg (max (- (point) (length pcomplete-stub))
>                      (pcomplete-begin)))
> What do you think will break if `min' is used instead of `max' to
> repair the following problem seen using `emacs -Q' at the said commit?
> M-x shell
> cd /tmp
> mkdir AAAA\ BB\ CCCC
> cd AAAA\ BB<tab>
> Autocomplete fails because (pcomplete-begin) returns the position of
> the first letter A but (length pcomplete-stub) is the length of "AAAA
> BB", which gives the position of the second letter A.  The function
> `max', therefore, sets `beg' to the start of the second letter A.
> Consequently, file-name-completion will be asked to complete "AAA BB"
> instead of the correct one "AAAA BB".
> Thank you.
> --
> Best regards,
> Tadeus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]