unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion.
Date: Sat, 17 Mar 2012 18:34:31 -0400	[thread overview]
Message-ID: <jwvlimyvpbz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sjh8wdbw.fsf@gmail.com> (Vitalie Spinu's message of "Fri, 16 Mar 2012 20:33:23 +0100")

>> Not sure why, but not terribly problematic either.
> Right, unless the completion retrieval is computationally intensive.

That could be a problem, but I haven't seen a circumstance where this is
the case yet.  This computation is only meant to decide which completion
table to use at a given buffer position.  The exact set of candidates
can be computed later.

> 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?

> 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.

> 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.

> 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.

> 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.

>>> 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.

You might be right.  The current behavior of "fall over" for
non-exclusive completion data is not cast in stone and is known to
have limitations.


        Stefan



  reply	other threads:[~2012-03-17 22:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 11:05 Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion Vitalie Spinu
2012-03-16 12:18 ` Vitalie Spinu
2012-03-16 17:20 ` Stefan Monnier
2012-03-16 19:33   ` Vitalie Spinu
2012-03-17 22:34     ` Stefan Monnier [this message]
2012-03-17 22:43       ` Lennart Borgman
2012-03-17 23:33       ` Vitalie Spinu
2012-03-18  2:03         ` Stefan Monnier
2012-03-18  9:35           ` Vitalie Spinu
2012-03-18 15:42             ` Stefan Monnier
2012-03-18 19:18               ` Vitalie Spinu
2012-03-19  0:53                 ` Stefan Monnier
2012-03-19  8:35                   ` Vitalie Spinu
2012-03-19 12:49                     ` Stefan Monnier

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=jwvlimyvpbz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=spinuvit@gmail.com \
    /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).