From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Dirk-Jan C. Binnema" Newsgroups: gmane.emacs.help Subject: ordering candidates when using completion-at-point-functions Date: Sat, 29 Jun 2013 12:43:14 +0300 Message-ID: <87wqpd2qx9.fsf@djcbsoftware.nl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372514549 25959 80.91.229.3 (29 Jun 2013 14:02:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Jun 2013 14:02:29 +0000 (UTC) To: "help-gnu-emacs\@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 16:02:30 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UsvjR-00054U-HK for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Jun 2013 16:02:29 +0200 Original-Received: from localhost ([::1]:50971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsvjR-00028c-6C for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Jun 2013 10:02:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usrgh-00055j-6A for help-gnu-emacs@gnu.org; Sat, 29 Jun 2013 05:43:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Usrgc-0001mz-UQ for help-gnu-emacs@gnu.org; Sat, 29 Jun 2013 05:43:23 -0400 Original-Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:45605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usrgc-0001mk-Nv for help-gnu-emacs@gnu.org; Sat, 29 Jun 2013 05:43:18 -0400 Original-Received: by mail-la0-f49.google.com with SMTP id ea20so2920406lab.36 for ; Sat, 29 Jun 2013 02:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:user-agent:from:to:subject:date:message-id:mime-version :content-type; bh=L65h/YPSokwqYrd2FCKYgpwLnkX6OJLOX5uojldybVY=; b=sfMmVR6ggnnEATp2CLTzMJXjqlkiuqpt8oXAUdvU78C0z2qTNbynHpbR4766aPZ33X Amy5BkoFkwChwOxBDDrbkPwwxM6i5NyUv6yL7Exd9OL0urXpBimqnGOhQMEwmh7iWP6h PmmBVkD7Usxl1SG3TkNn1SyWmuiut+zjYedbinYhtw9ZG8WDLS9SCtGMnC6Kt7pVoxLZ 9kjaKhgCCWZCpVz/FcS60Aa4JjcxIksC+9/i0jxrTEhPjXfDZHw1vcMx6mQmVsA2ALM6 2DoLtomEOq8rUoV0AKpJrCo2fHFXFj5ttwMV2s/tfku4WGlJDNniLzqaJRYxySe5OyZW M8Yw== X-Received: by 10.112.164.164 with SMTP id yr4mr8092446lbb.88.1372498997411; Sat, 29 Jun 2013 02:43:17 -0700 (PDT) Original-Received: from borealis (a88-112-252-184.elisa-laajakaista.fi. [88.112.252.184]) by mx.google.com with ESMTPSA id i9sm3859746lai.4.2013.06.29.02.43.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 29 Jun 2013 02:43:16 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.50.21 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-Mailman-Approved-At: Sat, 29 Jun 2013 10:02:12 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91852 Archived-At: 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