From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#4504: marked as done (23.1; [missing feature] `minibuffer-force-completion' does not cycle through completions) Date: Thu, 24 Sep 2009 15:15:05 +0000 Message-ID: References: <20090921142016.GA4717@mycomputer> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1253805305-2634-0" X-Trace: ger.gmane.org 1253806093 16919 80.91.229.12 (24 Sep 2009 15:28:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 15:28:13 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 24 17:28:05 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqqEm-0004VK-8e for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 17:28:04 +0200 Original-Received: from localhost ([127.0.0.1]:48488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqqEl-0002VQ-F6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 11:28:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqqDx-0002Bb-4a for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 11:27:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqqDs-000294-EQ for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 11:27:12 -0400 Original-Received: from [199.232.76.173] (port=55902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqqDr-00028l-Q8 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 11:27:08 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50259) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MqqDq-0008CX-Rv for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 11:27:07 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8OFR3fq004324; Thu, 24 Sep 2009 08:27:04 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8OFF5sP002658; Thu, 24 Sep 2009 08:15:05 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 4504 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31452 Archived-At: This is a multi-part message in MIME format... ------------=_1253805305-2634-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Thu, 24 Sep 2009 11:07:24 -0400 with message-id and subject line Re: bug#4504: 23.1; [missing feature] `minibuffer-force-co= mpletion' does not cycle through completions has caused the Emacs bug report #4504, regarding 23.1; [missing feature] `minibuffer-force-completion' does not cy= cle through completions to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 4504: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D4504 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1253805305-2634-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 21 Sep 2009 14:42:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA,FVGT_m_MULTI_ODD, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8LEgqes019751 for ; Mon, 21 Sep 2009 07:42:53 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mpk6O-0003tb-0M for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 10:42:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mpk6I-0003tB-JH for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 10:42:50 -0400 Received: from [199.232.76.173] (port=60777 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mpk6I-0003t8-Ck for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 10:42:46 -0400 Received: from mx20.gnu.org ([199.232.41.8]:63401) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mpk6H-0006UZ-Tu for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 10:42:46 -0400 Received: from smtp2f.orange.fr ([80.12.242.152]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mpk6G-0001bt-4l for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2009 10:42:44 -0400 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2f21.orange.fr (SMTP Server) with ESMTP id 34E598000041 for ; Mon, 21 Sep 2009 16:42:37 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2f21.orange.fr (SMTP Server) with ESMTP id 28FDA80000A6 for ; Mon, 21 Sep 2009 16:42:37 +0200 (CEST) Received: from orange.fr (ADijon-258-1-78-183.w90-13.abo.wanadoo.fr [90.13.61.183]) by mwinf2f21.orange.fr (SMTP Server) with SMTP id AA23A800004A for ; Mon, 21 Sep 2009 16:42:36 +0200 (CEST) X-ME-UUID: 20090921144236696.AA23A800004A@mwinf2f21.orange.fr Received: by orange.fr (nbSMTP-1.00) for uid 1000 bruno.barbier.cs@orange.fr; Mon, 21 Sep 2009 16:20:16 +0200 (CEST) Date: Mon, 21 Sep 2009 16:20:16 +0200 From: Bruno Barbier To: bug-gnu-emacs@gnu.org Subject: 23.1; [missing feature] `minibuffer-force-completion' does not cycle through completions Message-ID: <20090921142016.GA4717@mycomputer> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Problem The function `minibuffer-force-complete' does not cycle through completions; it just steps through the completion list once. * Step to reproduce: 1. In a shell emacs -Q --eval "(progn \ (define-key minibuffer-local-completion-map \ (kbd \"M-\" ) \ #'minibuffer-force-complete) \ (setq unread-command-events \ (append '(?\M-x ?s ?e ?t ?- ?v) \ '(tab M-tab M-tab) \ unread-command-events )) \ ) \ " 2. Hit M- * Result M- offers only "set-visited-file-name" as the sole completion. * Expected result M- should allow cycling through the choices: set-variable set-visited-file-name * Proposed solution See attached patch against today CVS version ([2009-09-21 Mon]). * Proposed ChangeLog item if needed. 2009-09-21 or whoever commits it * minibuffer.el: The function `minibuffer-force-complete' now cycles through the completion choices (it was just stepping through the completion list once). --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="minibuffer.el.patch" *** emacs/lisp/minibuffer.el Wed Sep 2 05:09:19 2009 --- patched-emacs/lisp/minibuffer.el Mon Sep 21 15:40:24 2009 *************** *** 528,536 **** (setq completion-all-sorted-completions (nconc all base-size)))))) (defun minibuffer-force-complete () "Complete the minibuffer to an exact match. ! Repeated uses step through the possible completions." (interactive) ;; FIXME: Need to deal with the extra-size issue here as well. (let* ((start (field-beginning)) --- 528,576 ---- (setq completion-all-sorted-completions (nconc all base-size)))))) + (defun minibuffer--rotate-completions (l) + "Rotate the list of completions L. + + The first element becomes the last one. More precisely: + (minibuffer--rotate-completions '(c1 c2 .. c_{n-1} cn . basesize)) + ==> + (cn c1 c2 .. c_{n-1} . basesize)" + (if (not l) l + (let* ( ;; The first pair of the final result. We will set its elements + ;; when we meet them. + (result (cons nil nil)) + ;; The current pair we are building. + (now result) + ;; The tail of the completions we want to rotate. + (tail (cdr l)) + ) + ;; We copy until the last pair. + (while (consp tail) + (let ((next (cons (car l) nil)) + ) + ;; make `now' points to next and shift to next. + (setcdr now next) + (setq now next) + ;; update what we want to rotate on. + (setq l tail) + (setq tail (cdr l)) + )) + ;; Tail is the final element: it is basesize or nil, + ;; l is the last pair and its car is the last completion item. + (setcar result (car l)) + (setcdr now (cdr l)) + result) + )) + ;; @TEST with basesize: (minibuffer--rotate-completions '(1 2 3 . 4)) + ;; ==> (3 1 2 . 4) + ;; @TEST no basesize: (minibuffer--rotate-completions '(1 2 3 4)) + ;; ==> (4 1 2 3) + ;; @TEST limit case: (minibuffer--rotate-completions '()) + ;; ==> nil + (defun minibuffer-force-complete () "Complete the minibuffer to an exact match. ! Repeated uses cycle through the possible completions." (interactive) ;; FIXME: Need to deal with the extra-size issue here as well. (let* ((start (field-beginning)) *************** *** 546,552 **** ;; completion-all-sorted-completions to nil, but we prefer not to, ;; so that repeated calls minibuffer-force-complete still cycle ;; through the previous possible completions. ! (setq completion-all-sorted-completions (cdr all))))) (defvar minibuffer-confirm-exit-commands '(minibuffer-complete minibuffer-complete-word PC-complete PC-complete-word) --- 586,594 ---- ;; completion-all-sorted-completions to nil, but we prefer not to, ;; so that repeated calls minibuffer-force-complete still cycle ;; through the previous possible completions. ! (setq completion-all-sorted-completions ! (minibuffer--rotate-completions all)) ! ))) (defvar minibuffer-confirm-exit-commands '(minibuffer-complete minibuffer-complete-word PC-complete PC-complete-word) --M9NhX3UHpAaciwkO-- ------------=_1253805305-2634-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4504-done) by emacsbugs.donarmstrong.com; 24 Sep 2009 15:07:46 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8OF7i9O001845 for <4504-done@emacsbugs.donarmstrong.com>; Thu, 24 Sep 2009 08:07:46 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqIEAKwou0pFpZBo/2dsb2JhbACBUtV0hBsFh34 X-IronPort-AV: E=Sophos;i="4.44,445,1249272000"; d="scan'208";a="46500294" Received: from 69-165-144-104.dsl.teksavvy.com (HELO ceviche.home) ([69.165.144.104]) by ironport2-out.pppoe.ca with ESMTP; 24 Sep 2009 11:07:24 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 5AD55B40F8; Thu, 24 Sep 2009 11:07:24 -0400 (EDT) From: Stefan Monnier To: Bruno Barbier Subject: Re: bug#4504: 23.1; [missing feature] `minibuffer-force-completion' does not cycle through completions Message-ID: References: <20090921142016.GA4717@mycomputer> <20090924075114.GA5313@mycomputer> Date: Thu, 24 Sep 2009 11:07:24 -0400 In-Reply-To: <20090924075114.GA5313@mycomputer> (Bruno Barbier's message of "Thu, 24 Sep 2009 09:51:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >> Thank you. I've installed a simpler patch (see below) that makes use of >> the `last' function. > Great. It's simpler and it works. > Thank you. Thanks for confirming, Stefan ------------=_1253805305-2634-0--