From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 11 16:09:08 2012 Received: (at submit) by debbugs.gnu.org; 11 Mar 2012 20:09:08 +0000 Received: from localhost ([127.0.0.1]:45296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6p4k-0002Hs-2A for submit@debbugs.gnu.org; Sun, 11 Mar 2012 16:09:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37958) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6iRc-0004Xx-I4 for submit@debbugs.gnu.org; Sun, 11 Mar 2012 09:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6hyo-0002a0-5M for submit@debbugs.gnu.org; Sun, 11 Mar 2012 08:34:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:48190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hyo-0002Zu-2O for submit@debbugs.gnu.org; Sun, 11 Mar 2012 08:34:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hyU-000469-7R for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2012 08:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6hyR-0002SN-Tm for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2012 08:34:09 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:65384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hyR-0002O2-Nf for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2012 08:34:07 -0400 Received: by bkwq16 with SMTP id q16so2515454bkw.0 for ; Sun, 11 Mar 2012 05:34:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :x-gm-message-state; bh=wRZ0DT8WPZ7vwHyDf2p4L+xBp/yYFnz2rRlxsn0YQJQ=; b=mX+3h7LCjwowJ3p7qgZs0PMMnA/0Er9mgFJC6EdLrXWUn6PAgkkvRVFZnx+FNIZP5V UWPL9G9C8kENx98/zx3rvXmxzlAefrPQe/4sP0Hct9hmtMB+zW42WIuHrHyyS/2MT4c4 yZATMvxErLrSCVD5fmO1mnjSi47y1bJizg4eVo8927W7BYnz8ZvRYIyoVj0D7PSQzs4F +4rAQm5zq+eCGDDbU/wEFBDogiZX6X4BRFQR38VQTai9oz6VMlVEldhBoe4PtSzxfyji VkSEDe5eiMqySn5bnBSUn8+AOU2Pngv2ARCMmusyfFepuGeGUqk//jOs9lE30UGoT9x3 B/Wg== Received: by 10.204.130.130 with SMTP id t2mr3360030bks.135.1331469243999; Sun, 11 Mar 2012 05:34:03 -0700 (PDT) Received: from DeadCat.horishniy.org.ua ([109.122.17.4]) by mx.google.com with ESMTPS id je3sm19192200bkb.15.2012.03.11.05.34.01 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Mar 2012 05:34:02 -0700 (PDT) From: Anonymous To: bug-gnu-emacs@gnu.org Subject: 23.3; ido-mode: ido-next-match / ido-prev-match work wrong with same elements Date: Sun, 11 Mar 2012 14:33:48 +0200 Message-ID: <87pqcj48r7.fsf@horishniy.org.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQlgywvH4y+stmRfw9F0am+N4NuaXw16Ux3+5BjavaxHS7Khl3pqLT5rsGaiadGuV9ma28bZ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 11 Mar 2012 16:09:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Recipe: (require 'ido) (ido-completing-read "dat is whrong -> " '("2" "3" "3" "3" "4" "5")) Browse this with C-s and C-r. C-s will stuck, C-r will jump to the first occurence of "3". I've managed to fix this. In ido-chop: first, we don't need to choose the first element. second, we should supply backward-move, to search in reverse. In this way, we find "last" element, as it shold really be. I did not fix all the functions, that use ido-chop, however. Here is the example with ido-prev-match. (defun ido-chop (items elem &optional backward-move) "Remove all elements before ELEM and put them at the end of ITEMS." (let ((ret nil) (next nil) (sofar nil)) (progn (setq next (car items)) (setq items (cdr items)) (setq sofar (cons next sofar))) (when backward-move (setq items (nreverse items))) (while (not ret) (setq next (car items)) (if (equal next elem) (progn (when backward-move (setq next (car items)) (setq items (cdr items)) (setq sofar (cons next sofar))) (setq ret (append items (nreverse sofar)))) ;; else (progn (setq items (cdr items)) (setq sofar (cons next sofar))))) (if backward-move (nreverse ret) ret))) (defun ido-prev-match () "Put last element of `ido-matches' at the front of the list." (interactive) (if ido-matches (let ((prev (car (last ido-matches)))) (setq ido-cur-list (ido-chop ido-cur-list prev t)) (setq ido-matches (ido-chop ido-matches prev t)) (setq ido-rescan nil)))) From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 11:03:04 2013 Received: (at 10994) by debbugs.gnu.org; 19 Mar 2013 15:03:04 +0000 Received: from localhost ([127.0.0.1]:35849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHy47-0008Sk-9b for submit@debbugs.gnu.org; Tue, 19 Mar 2013 11:03:04 -0400 Received: from mail-pb0-f52.google.com ([209.85.160.52]:42965) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHy43-0008SH-3c for 10994@debbugs.gnu.org; Tue, 19 Mar 2013 11:03:00 -0400 Received: by mail-pb0-f52.google.com with SMTP id ma3so501080pbc.39 for <10994@debbugs.gnu.org>; Tue, 19 Mar 2013 08:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:face:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=Qkb/xf294stLZeOJOVW2lsltPVur2zCv6fhI1GXJnvA=; b=pnehG/eQH0q9YOFWVqAinBrI63sXiXFpMwxYlU/LMVJKv7X2R1hAapjDwQzJHbJIZ3 R7JEU5Ur7RnCaSuqv+/IVdRQGM7mqiEt4RvUrAF98oxbnv3WSfp0weKpAJ4LjC28E3M5 PSZ83FGCiYImxSsSlO376p1FbSowQ5MOwOoZ1zVzYdm+AncNTfGwRnzrbpelIPQ5fjRJ sRIJq6M3HO3+ez1tjICuU/xmId0jQMzopVb1m85QFEUwfDRX435gNHM3TuQncLxTC7dx YguOIlZZ2VYUHigavZ4tvOkO/m94nGFCj4pYLaGKOOM+FWVuWytUGHTnwDzxUyOnnU9w MBXQ== X-Received: by 10.68.241.225 with SMTP id wl1mr3549463pbc.170.1363705278146; Tue, 19 Mar 2013 08:01:18 -0700 (PDT) Received: from localhost ([182.48.109.29]) by mx.google.com with ESMTPS id ol7sm24609267pbb.14.2013.03.19.08.01.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 Mar 2013 08:01:17 -0700 (PDT) From: Leo Liu To: Anonymous Subject: Re: bug#10994: 23.3; ido-mode: ido-next-match / ido-prev-match work wrong with same elements References: <87pqcj48r7.fsf@horishniy.org.ua> Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUzRVhbQj4eZqO6SjnT eWpxnMetm5b6/PmidmqrAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1F B9cBBwMLBfKABCMAAAFoSURBVCjPtZI9a8MwEIaFoc7aYDdelQMna0Em3tsSr0XUeE2Q6a22a+v+ fk8fSSBkbDUI6dHpfe9OEvRgiD+ApqKPJgJeB6iUUXWESjUe/ig38AJrhqqvaU2nTIXbNvOQ40fe qdry4kyGoVWsfCQalXpHnJGM01wjWdYbMlXNFdsZDO69m9aqNqxEJqTEgbM5OF7wlEfIoll1Ked4 LbM5X2EdILLokEdmI8z7g5cKED0cuTC930TYhy7ZDekkXVGw/L60TguJePPxcJF48lpsSUWEA/Ju jGFNgJOXc4Hz7TmAdBeu5Ve4AEjOi2/2jfd3cAJZ+IbNrvdjgBZY01b+HTuG3cLws6BJZqVOj/pp T0OqVwx3rFq+QmJwx3loK5JSLEhDIt62+mtC2C+SrAUxEbV6C6v2BRbd6pILBKFpepKZJHgGgrKF sptSUUoczpwg2pQ7ZH1tgs0ou/917mzz6Cs2//C978cv5l07L02orIEAAAAASUVORK5CYII= Date: Tue, 19 Mar 2013 23:01:06 +0800 In-Reply-To: <87pqcj48r7.fsf@horishniy.org.ua> (Anonymous's message of "Sun, 11 Mar 2012 14:33:48 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 10994 Cc: 10994@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 2012-03-11 20:33 +0800, Anonymous wrote: > (require 'ido) > (ido-completing-read "dat is whrong -> " '("2" "3" "3" "3" "4" "5")) Would you be able to give the following patch a though test? Thanks in advance. diff --git a/lisp/ido.el b/lisp/ido.el index 589f4417..6c747124 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3156,7 +3156,7 @@ (defun ido-chop (items elem) (sofar nil)) (while (not ret) (setq next (car items)) - (if (equal next elem) + (if (eq next elem) (setq ret (append items (nreverse sofar))) ;; else (progn From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 23:13:22 2013 Received: (at 10994-done) by debbugs.gnu.org; 20 Mar 2013 03:13:22 +0000 Received: from localhost ([127.0.0.1]:36478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UI9Ss-0000z9-3A for submit@debbugs.gnu.org; Tue, 19 Mar 2013 23:13:22 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:55879) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UI9Sp-0000z0-2R for 10994-done@debbugs.gnu.org; Tue, 19 Mar 2013 23:13:20 -0400 Received: by mail-pb0-f50.google.com with SMTP id up1so956856pbc.37 for <10994-done@debbugs.gnu.org>; Tue, 19 Mar 2013 20:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:face:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=tvpSdOEJxUvjGahk1aaQKb1KAejxYaquvZLg+x+0VAQ=; b=0Lj4jHbIfhYFQoV/A/fTUbP+tRfxN+w+MKSkka2yuivXuKO0m55f1plml9nQFkndsB gHzJgWR43BhVjunwb4mjAHZKe6R0KBkMlFOlGGYK2+6oWPiM2eg0LUyWI7Ytoitux5wO sYBfzIrUZQ6TRcpRteAokv/Pc1uwOXJs2FGSrQG+F7QFHsYbu+8oQmlIip3ZRv9n2e7h Ay36CVCIrYceMMGhYh3FxgWe7LlRJwIpK7t/DUpzS9VoeblejP5PoXAKGiqpQPU+CMrK QNHa4qot3DOCgu/4XqDzeRzfp04Bsx0/W85b1EzRNRgvRSm2Q9kit0EodRO+pxA/2oAk OXsw== X-Received: by 10.66.171.232 with SMTP id ax8mr6984850pac.67.1363749095396; Tue, 19 Mar 2013 20:11:35 -0700 (PDT) Received: from localhost ([123.108.223.39]) by mx.google.com with ESMTPS id ef3sm301832pad.20.2013.03.19.20.11.31 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 Mar 2013 20:11:34 -0700 (PDT) From: Leo Liu To: Anonymous Subject: Re: bug#10994: 23.3; ido-mode: ido-next-match / ido-prev-match work wrong with same elements References: <87pqcj48r7.fsf@horishniy.org.ua> Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC Date: Wed, 20 Mar 2013 11:11:27 +0800 In-Reply-To: (Leo Liu's message of "Tue, 19 Mar 2013 23:01:06 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10994-done Cc: 10994-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Fixed in 24.4. Patch seems working in my tests. So close the bug. Leo From unknown Sat Jun 21 03:28:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 17 Apr 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator