unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Dirk-Jan C. Binnema" <djcb@djcbsoftware.nl>
To: "help-gnu-emacs\@gnu.org" <help-gnu-emacs@gnu.org>
Subject: ordering candidates when using completion-at-point-functions
Date: Sat, 29 Jun 2013 12:43:14 +0300	[thread overview]
Message-ID: <87wqpd2qx9.fsf@djcbsoftware.nl> (raw)

Hi all,

I'm using completion-at-point-functions to do address-completion in
mu4e, an email-client that I wrote. This works fine [1]; however, by
default, it seems the candidates are in alphabetical order.

Instead, I would like to deliver the candidates in order of frequency; I
already got my list of contacts sorted in the right order, so all that's
needed (as far as I can see) is to have the completion system /not/ do
any sorting of its own, but just deliver the candidates in the same
order as in the list I provide. Is this possible? And, if so, how?

(An alternative might be to use a display-sort-function; it seems the
current org-contacts[2] does something like that; but this seems /very/
complicated solution, which is hopefully not necessary for my modest
needs...)

Thanks,
Dirk.

[1] https://github.com/djcb/mu/blob/master/mu4e/mu4e-compose.el#L495
[2] http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib/lisp/org-contacts.el

-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C



             reply	other threads:[~2013-06-29  9:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-29  9:43 Dirk-Jan C. Binnema [this message]
2013-07-04  0:32 ` ordering candidates when using completion-at-point-functions Stefan Monnier
2013-07-04  5:02   ` Dirk-Jan C. Binnema
2013-07-04  5:23     ` Jambunathan K

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=87wqpd2qx9.fsf@djcbsoftware.nl \
    --to=djcb@djcbsoftware.nl \
    --cc=help-gnu-emacs@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.
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).