emacs-devel
[Top][All Lists]
Advanced

[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: Fri, 16 Mar 2012 20:33:23 +0100
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (gnu/linux)

>>>> Stefan Monnier <address@hidden>
>>>> on Fri, 16 Mar 2012 13:20:19 -0400 wrote:

  >> Place your point at the end of 'aaaa and you try to complete. I am
  >> getting 

  >> aaa:
  >> aaaa:

  >> in my message buffer.  Which means the completion is called twice.

  > Not sure why, but not terribly problematic either.

Right, unless the completion retrieval is computationally
intensive. Please see my other message with a more serious related
issue. It might give some clues.

  >> I hope this is not an intended behavior, as it might seriously
  >> interfere with custom completion.  For example I might want to have
  >> a different behavior on the second consequent invocation of the
  >> completion (give a message, modify the candidates etc).

  > No, completion-at-point-functions should return completion data and
  > can't know what that data will be used for.  Could be for TAB
  > completion, for on-the-fly popup completion à la auto-complete, for
  > display of the *Completions* buffer, or to decide whether we're still in
  > the same completion field (so as to pop-down the *Completions* buffer
  > when we leave that field), ...

In my case it's meaningful, as I retrieve completions from a
process. And if there is no process associated with a buffer, I want to
message: "Dude stop pressing TAB, there is no proc!!""

Also I think, popup functions should use a different list (like
completion-popup-functions). As users might want to use different sets
of completions. Also popup completions *must* be considerably less
computationally intensive, so it's probably a different set of functions
anyhow.

  >> Second problem is that if the completion is sole, the handling is not
  >> passed over.

  > That's expected: completion is only passed over if the text doesn't
  > match any candidate.

IMHO, this is far form an ideal default. Take an example of two
completions, one for symbols, another for functions. Or, even the etags
completion which is always the last, and might give many more candidates
with the same prefix.

Best, 
Vitalie.



reply via email to

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