[Top][All Lists]

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

Re: enabling company-capf support in cfengine.el

From: Stefan Monnier
Subject: Re: enabling company-capf support in cfengine.el
Date: Fri, 17 Jan 2014 08:04:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> And many of them still behave inappropriately, like
> semantic-ia-complete-symbol' and `nxml-complete'.

Whenever you bump into such problems, do report them.  I'll take a look
at the above two.

>> BTW, the next step would be to supplant other company backends, like
>> we've done with company-elisp: company-css, company-nxml, and
>> company-semantic look like prime candidates.
> Indeed.  Although I'm not sure what would be an appropriate counterpart in
> CAPF for `company-semantic--pre-prefix-length'.

You mean, what should be the counterpart to:

   cannot \(e.g. if it is in the middle of a string\).  Instead of a string,
   the back-end may return a cons where car is the prefix and cdr is used in
   `company-minimum-prefix-length' test.  It's either number or t, in which
   case the test automatically succeeds.

A straightforward option might be to have CAPF return
a new :company-prefix-length-offset property which is then added to the
prefix length by company-capf.

>From a more CAPF-centric point of view, in the case of Semantic, another
option is to return as prefix not "ch" but "fr->ch", and then specify
a boundary between "fr->" and "ch".

> With Semantic, we also have the question of alternatives.  At the moment,
> company-semantic' goes before `company-clang', so that if semantic-mode is
> enabled, the former is used, and otherwise, the latter.

That's easy to solve: turn company-clang into its CAPF equivalent, then
place it within completion-at-point-functions after the Semantic one.


reply via email to

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