From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Sorting Order of Completion Candidates Date: Mon, 28 Feb 2011 17:25:46 -0800 Message-ID: References: <4D6BB13E.3040404@miszellen.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298942829 21083 80.91.229.12 (1 Mar 2011 01:27:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2011 01:27:09 +0000 (UTC) To: "'Florian Beck'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 01 02:27:04 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PuEMg-0003XE-W4 for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Mar 2011 02:27:03 +0100 Original-Received: from localhost ([127.0.0.1]:49058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuEMe-0000rY-4A for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Feb 2011 20:27:00 -0500 Original-Received: from [140.186.70.92] (port=41716 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuEMB-0000o2-T7 for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 20:26:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuEMA-0005by-SP for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 20:26:31 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:37788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuEMA-0005bt-MI for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 20:26:30 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54278) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PuEMA-00087Q-3p for gnu-emacs-help@gnu.org; Mon, 28 Feb 2011 20:26:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuEM8-0005bQ-A5 for gnu-emacs-help@gnu.org; Mon, 28 Feb 2011 20:26:29 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:56379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuEM8-0005b0-3f for gnu-emacs-help@gnu.org; Mon, 28 Feb 2011 20:26:28 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p211QNhq017667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Mar 2011 01:26:25 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p2115p5K027018; Tue, 1 Mar 2011 01:26:20 GMT Original-Received: from abhmt013.oracle.com by acsmt353.oracle.com with ESMTP id 1045694451298942752; Mon, 28 Feb 2011 17:25:52 -0800 Original-Received: from dradamslap1 (/10.159.51.211) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 Feb 2011 17:25:52 -0800 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <4D6BB13E.3040404@miszellen.de> Thread-Index: AcvXrAGE3V+dn9BbRVuREB2uV6JWNAAATpvw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4D6C4B3F.00FD:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79599 Archived-At: > While writing some code to index my notes I have run into a problem. > I have a carefully crafted list of keywords sorted in order of > frequency. (When assigning new keywords I want to consider the most > frequent keywords first.) However > (completing-read "Prompt: " '("a" "c" "b")) gives me > > Possible completions are: > a > b > c > > whereas I want > > Possible completions are: > a > c > b > > If there is no option or hook, if guess I could just modify the > *Completions* buffer. Any hints how/where it is set up? 1. Stefan can probably steer you as to how to do what you want with a recent version of vanilla Emacs. 2. An alternative is to use Icicles. Then all you need to do is bind `icicle-sort-comparer' to nil around the call to `completing-read'. A nil value means do not sort. (You can also customize `icicle-sort-comparer' to use any default sort order you like.) You can also change sort orders on the fly anytime during completion, and that includes turning sorting off: hit `C-,' to cycle to the next sort order for the current completion type. (One of the sort orders is unsorted (off).) Sorting is particularly important for Icicles because it affects the order of candidate cycling. http://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates