all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: emacs-devel@gnu.org
Subject: completion discrepancy between default completion and helm/ivy completions
Date: Thu, 10 Nov 2016 12:22:42 +0100	[thread overview]
Message-ID: <m2twbfmvel.fsf@charm-wifi.irisa.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

Hello,

I'm tracking down a bug with org-contacts during completion, and I have
found the source to be a discrepancy between how default completion is
computed (using `completion-basic-try-completions') and how ivy/helm
completion is computed (using `completion-basic-all-completions').

In the first case, the result of the completion function is tested to be
a string, and tweaked if it is:

        (let ((completion (try-completion beforepoint table pred)))
          (if (not (stringp completion))
              completion
            (cons
             (concat completion
                     (completion--merge-suffix completion point afterpoint))
             (length completion))))

In the all-completions case, there is no such test, so the completion is
returned as such.

In org-contacts, the completion is defined as a function that returns is
a string, so it works with default completion but not with ivy or helm.

I would like to fix org-contacts so that it works well all the time.
Should it directly return a cons of the string and its length?

Thanks a lot for any help, and if this is not the place to ask such
questions, please let me know the right list.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2016-10: 401.57, 2015-10: 398.29

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

             reply	other threads:[~2016-11-10 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 11:22 Alan Schmitt [this message]
2016-11-10 20:35 ` completion discrepancy between default completion and helm/ivy completions Stefan Monnier
2016-11-13 13:05   ` Alan Schmitt
2016-11-13 15:38     ` Stefan Monnier
2016-11-14 13:22       ` Alan Schmitt
2016-11-14 14:20         ` 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=m2twbfmvel.fsf@charm-wifi.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --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.