From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: completion-cycle-threshold and a suggestion Date: Fri, 21 May 2010 21:43:03 +0100 Organization: University of Cambridge Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274474608 24764 80.91.229.12 (21 May 2010 20:43:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 May 2010 20:43:28 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 21 22:43:26 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@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 1OFZ3z-00025Y-Et for ged-emacs-devel@m.gmane.org; Fri, 21 May 2010 22:43:23 +0200 Original-Received: from localhost ([127.0.0.1]:41323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFZ3y-0001xY-Tx for ged-emacs-devel@m.gmane.org; Fri, 21 May 2010 16:43:22 -0400 Original-Received: from [140.186.70.92] (port=53936 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFZ3t-0001wX-8W for emacs-devel@gnu.org; Fri, 21 May 2010 16:43:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFZ3q-00053T-5R for emacs-devel@gnu.org; Fri, 21 May 2010 16:43:15 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:56042) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFZ3p-00053N-Vu for emacs-devel@gnu.org; Fri, 21 May 2010 16:43:14 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OFZ3o-00020Q-DV for emacs-devel@gnu.org; Fri, 21 May 2010 22:43:12 +0200 Original-Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 May 2010 22:43:12 +0200 Original-Received: from sdl.web by smaug.linux.pwf.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 May 2010 22:43:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 40 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: smaug.linux.pwf.cam.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:1+ZbcD6dat0ep/IDXQBM/m4GSYg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125006 Archived-At: Hello Stefan, Thank you for adding more features to completion. I have started using this completion-cycle-threshold. Incidentally I have written a pcompletion for git and I have this function: ;; (pcmpl-git-string-lessp "word" "word-") ; => nil ;; (pcmpl-git-string-lessp "words" "word-") ; => t (defun pcmpl-git-string-lessp (s1 s2) "Compare strings S1 and S2 but treat '-' specially." (let ((res (compare-strings s1 0 nil s2 0 nil)) c1 c2) (if (eq res t) (setq res 0)) (ignore-errors ;; the following setq could trigger errors (setq c1 (aref s1 (1- (abs res))) c2 (aref s2 (1- (abs res)))) (if (or (= c1 ?-) (= c2 ?-)) (setq res (- res)))) (if (> res 0) nil t))) to address the sorting of things like: remote remote-ftp remote-ftps remote-http remote-https i.e. when I 'git rem' I want to see remote first before seeing the rest. The current completion cycle has this issue, for example, assume there are two possible completions 'feature' and 'feature-old', feature-old is seen first. This is counter-intuitive to the behaviour without completion cycle. Best wishes, Leo