Subject: Re: bug#29398: company-minimum-prefix-length

From: Tassilo Horn <[email-masked]>
Date: Thu, 23 Nov 2017 08:14:58 +0100

Mosè Giordano <[email-masked]> writes:

Hi Fred and Mosè,

>> The root of the problems seems this code in auctex/tex.el in v11.91
>>
>> ;; By default, company completions kick in after a prefix of 3 chars has
>> ;; been typed.  Since we don't have too many completions, that's too
>> ;; much.
>> (set (make-local-variable 'company-minimum-prefix-length) 1)))
>>
>> I don't understand the explanation given for creating this local
>> variable.

The explanation is that usually there are not too many TeX completions,
so if the completion popup would kick not before three characters are
typed, in many cases there would only be one single completion candidate
left over.

\alpha, \beta, \cite, and \label are typical examples.  If the standard
`company-minimum-prefix-length' of 3 was used, you would need to type
\alp, \bet, \cit, and \lab before the completion would kick in, and then
there would only be one single candidate left, so that wouldn't be very
helpful.

(Of course, if you use many packages in a document, the number of
available completions might be larger and with more overlay, so a higher
prefix length might be reasonable.)

>> I request that it be removed or done in such a way that it doesn't
>> override global user settings.
>
> You can override this setting with
>
> (add-hook 'TeX-mode-hook
>       '(lambda ()
>          (setq company-minimum-prefix-length 3)))
>
> However, I see that you'd like to avoid setting again the option.
> Tassilo, could you please give a look at this?

Well, I can simply remove it and add some docs explaining how users can
override the standard value for TeX modes for users who actually like
the current behavior (like myself).  Should I?

Bye,
Tassilo