emacs-devel
[Top][All Lists]
Advanced

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

Re: /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support f


From: Stefan Monnier
Subject: Re: /srv/bzr/emacs/elpa r395: * company.el (company-capf): Add support for `sorted' and `post-completion'.
Date: Sun, 05 May 2013 21:18:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>>>> ;; (defun company-my-backend (command &optional arg &rest ignored)
>>>> -;;   (case command
>>>> -;;     (prefix (when (looking-back "foo\\>")
>>>> +;;   (pcase command
>>>> +;;     (`prefix (when (looking-back "foo\\>")
>>>> ;;               (match-string 0)))
>>>> -;;     (candidates (list "foobar" "foobaz" "foobarbaz"))
>>>> -;;     (meta (format "This value is named %s" arg))))
>>>> +;;     (`candidates (list "foobar" "foobaz" "foobarbaz"))
>>>> +;;     (`meta (format "This value is named %s" arg))))
>>> Like the header in company.el says, we still try to support Emacs 22 and
>>> 23. `pcase' was only added in 23.3, I believe.
>> But this is in a comment, so it's not a problem.
> I'm not sure recommending to users to write new backends in a way
> incompatible with older Emacs is good.

It is in my interest to encourage all users to move to a more
recent Emacs.  And even more so to encourage them to move away from `cl'
(which will be a long and arduous path, so every bit helps).

> I guess I'll remove `(init nil)', then.
> By the way, if you think that `init' is useless for all backends, I don't
> believe that's true for `ropemacs' and `clang'. Retrying initialization once
> per buffer is fairly useful.

There are many ways to do initialization in the backend (once per
session, once per buffer, once per blue moon, you name it) without using
`init'.

>> `completion-extra-properties' can have anything you want in it.
>> Same for `completion-metadata'.  Of course, new entries in these
>> alists/plists won't be understood by other users of
>> completion-at-point-functions, but that's not a problem in itself.
> Ah okay, so I guess that section has everything to do with moving some
> company backends to completion-at-point functions.

Very much so, yes.

> This is totally fine for `company-capf', but `company-begin-with' is an old
> function/feature.

But I'm only suggesting to change it in more recent versions of Company,
so it won't affect old users.


        Stefan



reply via email to

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