[Top][All Lists]

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

Re: Completion with (:exclusive 'no) is called twice, and doesn't pass o

From: Vitalie Spinu
Subject: Re: Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion.
Date: Sun, 18 Mar 2012 00:33:44 +0100
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (gnu/linux)

>>>> Stefan Monnier <address@hidden>
>>>> on Sat, 17 Mar 2012 18:34:31 -0400 wrote:

  >> Please see my other message with a more serious related issue.
  >> It might give some clues.

  > I do not see your other message.  Is it on emacs-devel or a bug-report?

Yes to emacs-devel,

  >> In my case it's meaningful, as I retrieve completions from a
  >> process.

  > Then you should probably get your completions from the completion-table,
  > rather than from completion-at-point-functions.
  > IOW your completion-at-point-functions should return (without contacting
  > any process, other than maybe checking whether a process exists)
  > a completion table that's a function, e.g. built with
  > completion-table-dynamic, or using complete-with-action and it's *that*
  > function which contacts the process.

Thanks for the pointer. I was not aware of this distinction. But why
would that make a difference? Isn't the end result the same? Info is
silent on this.

  >> Also I think, popup functions should use a different list (like
  >> completion-popup-functions).

  > That might be right (tho I hope it's not), but it doesn't eliminate the
  > fact that completion-at-point-functions might be called in
  > various circumstances.

I've written auto-complete support and emacs-24 completion at point for
R. And it turned out that these two are really distinct features. One is
fast, cache based and sloppy, as it should not interfere with the
editing. Another one is exact and might be very slow, because it
contacts the associated process. The TAB completions can afford to be
slow, as there is no editing.

  >> As users might want to use different sets of completions.

  > I expect completion-at-point-functions to be setup by major modes rather
  > than by users.

Take auto-complete as an example. There are plenty of different
ac-sources, and users use whatever completion they want.

Related topic.  It would be great to have a separate "namespace" for all
buildin completions, or even a dedicated package. Then users and
developers can easily find buildin stuff.

For instance `completion-filename' instead of `comint-filename-completion',
 `completion-etags' instead of `tags-completion-at-point-function'
etc. Auto-complete package is a good example here - all sources start
with "ac-source-".

  >> Also popup completions *must* be considerably less computationally
  >> intensive, so it's probably a different set of functions anyhow.

  > The way I see it, completion-at-point-functions would instead include in
  > the `props' it returns, enough info to determine whether to use that
  > completion data for popup completion.

To return the props it still must be called, right? Indeed if the
completion function were aware that it was called from popup, then it
can simply return nil to be skipped. But, AFAICT, this is not currently
the case.


reply via email to

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