unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Antoine Levitt <antoine.levitt@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: ERC completion
Date: Mon, 02 May 2011 21:47:51 -0300	[thread overview]
Message-ID: <jwv8vuo39dp.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87fwowx03n.fsf@gmail.com> (Antoine Levitt's message of "Mon, 02 May 2011 23:29:32 +0200")

> Right, I think I (finally) see. I thought the completion-at-point thingy
> was designed from the ground up to merge several completion sources,
> which is why I was thoroughly confused by this conversation.

It is designed for this, but for completions which are context
sensitive.

> Judging from the various codes on the internet
> (http://www.emacswiki.org/emacs/HippieExpand for instance), several
> others have a need for this kind of things.

Yes, that's why I'm keeping this thread open.

> What about a switch, completion-include-alternate-completions or
> something, that'd make completion-at-point do what I thought it did, ie
> also run the other completion-at-point functions, and not stop at the
> first one that returns non-nil, and then merge all these completions,
> hopefully doing something clever when the START and END of these
> different completions change between each one? Would that be doable?

I'm thinking of letting the completion function return some :fallthrough
option which would tell completion-at-point that in case the completion
data it returned leads to a completion failure, then it should continue
with the next completion function.

And yes, if the start&end of the various alternatives is the same, we
can merge them easily via completion-table-in-turn (which would have
effects such as: first try prefix-nick-completion, then
prefix-dabbrev-completion, then partial-nick-completion, then
partial-dabbrev-completion).  OTOH if start&end aren't the same it
forces separate calls to the completion UI, relying on the completion UI
to tell us whether the completion operation (whether it is to perform
completion, or to display completions, or whatever else)
was successful in order to know whether to try with the next
completion data.


        Stefan



      reply	other threads:[~2011-05-03  0:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27 18:58 ERC completion Antoine Levitt
2011-04-28  0:18 ` Stefan Monnier
2011-04-28 10:44   ` Antoine Levitt
2011-04-28 19:34     ` Stefan Monnier
2011-04-28 19:48       ` Antoine Levitt
2011-04-29  0:50         ` Stefan Monnier
2011-04-29  7:43           ` Antoine Levitt
2011-04-29 15:20             ` Stefan Monnier
2011-04-29 20:50               ` Antoine Levitt
2011-05-02 15:02                 ` Stefan Monnier
2011-05-02 15:19                   ` Antoine Levitt
2011-05-02 18:04                     ` Stefan Monnier
2011-05-02 21:29                       ` Antoine Levitt
2011-05-03  0:47                         ` Stefan Monnier [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwv8vuo39dp.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=antoine.levitt@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).