all messages for Emacs-related lists mirrored at yhetil.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: Thu, 28 Apr 2011 21:50:09 -0300	[thread overview]
Message-ID: <jwvoc3pkhy9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87liyujgxv.fsf@gmail.com> (Antoine Levitt's message of "Thu, 28 Apr 2011 21:48:12 +0200")

>>> Sorry, it isn't ignored. But rather, erc-pcompletions-at-point always
>>> return non-nil, even when it does not complete anything, so that my
>>> customization
>>> (setq erc-complete-functions '(erc-pcompletions-at-point
>>> my-dabbrev-expand))
>>> does not work as expected. (the intent is to have dabbrev take over if
>>> I'm not completing a nick)
>> Hmm, does the patch below help?

> It's looks like it's a step in the right direction, but it does not fix
> the problem: "completions" is still non-nil, and includes every nick,
> even those that don't begin by the word before point.

I see.  The problem is that completion-at-point-functions is meant to
first decide what kind of completion should take place at point,
regardless of whether the text at point might match any one of those
completions (and determining whether or not it matches would need to pay
attention to completion-styles and completion-in-region-function, ...,
i.e. do a dry-run of completion-in-region).  Note that the decision
should take place separately from the completion itself since we want to
be able to do things like completion-help-at-point.

IIUC in your case, you seem to want to use "nick completion if such
a completion exists, or else fallback on dabbrev".

I'm not sure how best provide that kind of behavior (other than by
trying to merge the two entries using something like
completion-table-in-turn).

> Also, while on the subject of ERC completions, it seems an extra space
> is appended after erc-pcomplete-nick-postfix, originating from the same
> commit.

Hmm... can you show me exactly what you've done, what was the result
with the code and what is the result with the new code?


        Stefan



  reply	other threads:[~2011-04-29  0:50 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 [this message]
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

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