emacs-devel
[Top][All Lists]
Advanced

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

Re: Completions in Semantic


From: Eric M. Ludlam
Subject: Re: Completions in Semantic
Date: Tue, 27 Oct 2009 22:25:07 -0400

On Tue, 2009-10-27 at 20:56 -0400, Stefan Monnier wrote:
> >> As for this "extra info", I see what you mean, but usually completion
> >> involves several potential candidates, so listing them all plus all
> >> their info would take way too much space in general (if not, then
> >> something like completion-annotate-function should work).
> 
> > What I described is similar to `completion-annotate-function', but
> > more flexible (prefixed in the symbol/identifier, postfixed; some in
> > overlay, some in minibuffer, etc).
> 
> Right, so the question is: how should the generic code make such
> flexibility available (and conversely) how shojuld the client of the
> completion code be able to exploit/provide such flexibility.
> 
> I'm very interested in adding such hooks into the completion code, but
> I haven't come up with any convincing idea of what they should look like
> (the closest I got is completion-annotate-function which is very
> limited).  So suggestions are welcome (patches as well, of course, tho
> it's not crucial).

Are you looking for examples of hooks that would be needed, or examples
of behaviors that need hooks to be designed?

Here are some thoughts:

* Annotate completions buffer output (as you describe)
- I used to add () to a fcn, or other little things but clicking on a
  completion name would then insert too much, so I removed the feature
  from my version.

* Alternate completion list display mechanisms
- Inline completions like using a popup window.  I used a tooltip, but 
  it doesn't doesn't look as nice and isn't interactive

* Focus concept
- Once a completions list is short enough, TABs that don't complete can
  instead 'focus' on a completion.  Each new TAB moves the focus.

  The focus could do almost anything depending on what is being
completed.  For tags, it will flash the location of the tag in a buffer.
It could show doc, or any other differentiating data that might be
available.  ie - in Info nodes it could show the first paragraph.  For
files it could show the first 500 bytes or some file status, for a
buffer it could flip to it temporarily.  I expect most completable
things could do something special.

  For inline completion, the focus can be used to ghost in the text that
would be inserted if one selected that focus.  Pressing RET when
something is focused makes that item become the select entry w/out
having to type it.

Eric




reply via email to

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