all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Eric M. Ludlam" <eric@siege-engine.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@stupidchicken.com>, emacs-devel@gnu.org
Subject: Re: Completions in Semantic
Date: Mon, 19 Oct 2009 18:17:08 -0400	[thread overview]
Message-ID: <1255990628.6961.1084.camel@projectile.siege-engine.com> (raw)
In-Reply-To: <jwvoco3qhk8.fsf-monnier+emacs@gnu.org>

On Mon, 2009-10-19 at 16:06 -0400, Stefan Monnier wrote:
> >> You mean like lisp-complete-symbol but modal?
> 
> > Yes, that's what I meant, but in light of your simplified description, I
> > suppose it doesn't matter much.  If there was a single function like
> > 'completing-read' that took arguments to control what proposed text
> > after the cursor was, I suppose it wouldn't matter what happened
> > underneath.  I used overlays and overlay keymaps.
> 
> > You could try semantic-complete-analyze-inline on something that needs
> > completing to see the effect I was going for.  It should work for Lisp
> > or C code.
> 
> > I would expect designing such a thing would be challenging since the
> > rules for what is before the cursor is a bit vague and language
> > specific, so it might belong in a tool like Semantic.
> 
> We have `symbol-complete' although I'm not very happy about its API.
> But something along thses lines would be good.  When I rewrite the
> minibuffer completion code I tried to make it possible to use it in
> non-minibuffer contexts, so for example lisp-complete-symbol nowadays
> uses minibuffer-complete internally.

I was unaware of that, but it sounds useful.

> I also intend to consolidate the comint completion this way, tho it's
> more difficult because its current UI is slightly different.  Part of
> the difficulty is how to determine when the "completion is done" so as
> to know when to pop-down the *Completions* buffer (if any).  Maybe the
> best option is to pop-down *Completions* eagerly ("all the time").

For my completion engine, I used an overlay to wrap the text being
completed.  As soon as the cursor leaves the overlay, or if the user
types a character that doesn't belong in the symbol such as SPC, ., or
other punctuation, then it exists.  The post-command-hook is a bit
complex during the semantic inline completion.  Perhaps that style of
interface could be used, if not directly.

I was going for something where the completion part could activate at
idle time without interfering with regular editing commands.  ie, if the
user was typing away or using point motion, nothing would change, but if
they saw the decoration indicating active completion, they would know
that TAB was special.

A side effect is that a *completions* buffer is not always desired, so
there are some experiments on completion showing that might not need a
buffer, such as the tooltip, or ghost-text.  These options have varying
success in this task.

The semantic complete code for inline stuff uses the same completion and
display engines as the minibuffer or inline prompts, so you can mix and
match the pieces.  Hopefully an official API can do something similar,
so you can complete in the minibuffer or inline with the same functions.

Eric




  reply	other threads:[~2009-10-19 22:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-18 23:00 Completions in Semantic Chong Yidong
2009-10-18 23:55 ` Miles Bader
2009-10-19  3:50 ` Eric M. Ludlam
2009-10-19 13:48   ` Stefan Monnier
2009-10-19 16:26     ` Eric M. Ludlam
2009-10-19 18:29       ` Stefan Monnier
2009-10-19 19:33         ` Eric M. Ludlam
2009-10-19 20:06           ` Stefan Monnier
2009-10-19 22:17             ` Eric M. Ludlam [this message]
2009-10-20  0:07               ` Lennart Borgman
2009-10-30 21:17                 ` Toby Cubitt
2009-10-30 21:37                   ` Lennart Borgman
2009-10-20  0:14               ` Stefan Monnier
2009-10-20 20:20                 ` Eric M. Ludlam
2009-10-21 10:58                   ` Lluis
2009-10-21 12:35                     ` Eric M. Ludlam
2009-10-21 13:28                       ` Lluis
2009-10-21 17:35                         ` Eric M. Ludlam
2009-10-22 20:12                     ` Stefan Monnier
2009-10-27 21:21                       ` Lluis
2009-10-28  0:56                         ` Stefan Monnier
2009-10-28  2:25                           ` Eric M. Ludlam
2009-10-28  3:23                             ` Stefan Monnier
2009-10-29 14:38                               ` Lluis
2009-10-31 20:18                                 ` Stefan Monnier
2009-11-01 16:01                                   ` Lluís
2009-11-02  6:12                                     ` Stefan Monnier
2009-11-02 12:13                                       ` Eric M. Ludlam
2009-10-22 20:00                   ` Stefan Monnier
2009-10-19 23:52   ` Eric M. Ludlam
2009-10-21 14:07     ` Chong Yidong
2009-10-21 16:10       ` Eric M. Ludlam
2009-10-23  1:01         ` Chong Yidong
2009-10-23  1:28           ` Eric M. Ludlam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255990628.6961.1084.camel@projectile.siege-engine.com \
    --to=eric@siege-engine.com \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.