From unknown Sat Sep 20 12:49:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#4219 <4219@debbugs.gnu.org> To: bug#4219 <4219@debbugs.gnu.org> Subject: Status: 23.1; case insensitive + partial completions Reply-To: bug#4219 <4219@debbugs.gnu.org> Date: Sat, 20 Sep 2025 19:49:30 +0000 retitle 4219 23.1; case insensitive + partial completions reassign 4219 emacs submitter 4219 Eli Barzilay severity 4219 normal thanks From eli@barzilay.org Thu Aug 20 19:49:41 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Aug 2009 02:49:41 +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.9 required=4.0 tests=AWL,FOURLA 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 n7L2ndpu017965 for ; Thu, 20 Aug 2009 19:49:41 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeKCB-0007l4-J8 for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 22:49:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeKC7-0007em-4E for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 22:49:39 -0400 Received: from [199.232.76.173] (port=52796 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeKC6-0007eW-Rk for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 22:49:34 -0400 Received: from winooski.ccs.neu.edu ([129.10.115.117]:56500 helo=barzilay.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MeKC6-0003pm-IW for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 22:49:34 -0400 Received: from eli by barzilay.org with local (Exim 4.66) (envelope-from ) id 1MeKC5-0005QA-Hq for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2009 22:49:33 -0400 From: Eli Barzilay To: bug-gnu-emacs@gnu.org Subject: 23.1; case insensitive + partial completions Message-Id: Date: Thu, 20 Aug 2009 22:49:33 -0400 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Start with a default Emacs, and (setq read-file-name-completion-ignore-case t) (setq completion-styles '(partial-completion)) Now go to a directory that has two files called INSTALL install-sh Hit `C-x C-f ins TAB' -- it will be completed to "insTALL". In GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.14) of 2009-08-01 on winooski.ccs.neu.edu Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--prefix=/home/eli/bin/local/emacs-dir'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: POSIX value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t Major mode: Dired by name Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t From cyd@stupidchicken.com Fri Sep 11 18:23:27 2009 Received: (at 4219) by emacsbugs.donarmstrong.com; 12 Sep 2009 01:23:27 +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.4 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po45.its.yale.edu (pantheon-po45.its.yale.edu [130.132.50.79]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8C1NQ4l008927 for <4219@emacsbugs.donarmstrong.com>; Fri, 11 Sep 2009 18:23:27 -0700 Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po45.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n8C1NKqn009860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 11 Sep 2009 21:23:20 -0400 Received: by furry (Postfix, from userid 1000) id 5CBE7C070; Fri, 11 Sep 2009 21:23:20 -0400 (EDT) From: Chong Yidong To: Stefan Monnier Cc: Eli Barzilay , 4219@debbugs.gnu.org Subject: Re: 23.1; case insensitive + partial completions Date: Fri, 11 Sep 2009 21:23:20 -0400 Message-ID: <87fxatq7lj.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) > Start with a default Emacs, and > > (setq read-file-name-completion-ignore-case t) > (setq completion-styles '(partial-completion)) > > Now go to a directory that has two files called > > INSTALL > install-sh > > Hit `C-x C-f ins TAB' -- it will be completed to "insTALL". Stefan, could you take a look at this? I glanced through your partial completion code, and it's clear where the problem arises. In completion-pcm--merge-try, (completion-pcm--merge-completions all pattern) returns (all "TALL" "ins") and so completion-pcm--pattern->string naively joins the result into "insTALL". However, I don't know how to fix this. The default completion style actually does the right thing, because it can just replace the string wholesale, but I'm not sure if the pcm style can do the same thing. From monnier@iro.umontreal.ca Sun Sep 13 20:35:20 2009 Received: (at 4219) by emacsbugs.donarmstrong.com; 14 Sep 2009 03:35:21 +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.pppoe.ca [206.248.154.181] (may be forged)) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8E3ZIji013182 for <4219@emacsbugs.donarmstrong.com>; Sun, 13 Sep 2009 20:35:20 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlkFAIZWrUpFpZBe/2dsb2JhbACBUtgihBgFgVaGHg X-IronPort-AV: E=Sophos;i="4.44,381,1249272000"; d="scan'208";a="45635310" Received: from 69-165-144-94.dsl.teksavvy.com (HELO pastel.home) ([69.165.144.94]) by ironport2-out.pppoe.ca with ESMTP; 13 Sep 2009 23:33:35 -0400 Received: by pastel.home (Postfix, from userid 20848) id DC99F8356; Sun, 13 Sep 2009 23:35:12 -0400 (EDT) From: Stefan Monnier To: Eli Barzilay Cc: 4219@debbugs.gnu.org Subject: Re: bug#4219: 23.1; case insensitive + partial completions Message-ID: References: Date: Sun, 13 Sep 2009 23:35:12 -0400 In-Reply-To: (Eli Barzilay's message of "Thu, 20 Aug 2009 22:49:33 -0400") 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 >>>>> "Eli" == Eli Barzilay writes: > Start with a default Emacs, and > (setq read-file-name-completion-ignore-case t) > (setq completion-styles '(partial-completion)) > Now go to a directory that has two files called > INSTALL > install-sh > Hit `C-x C-f ins TAB' -- it will be completed to "insTALL". I think the patch below will help out. You may still get such inconsistent results in different parts of a completion (e.g. completing "fo-ba" against "FOO-BAR" and "foo-bar" may return "FOO-bar"), but at least the above case should be handled better. Stefan --- minibuffer.el.~1.83.~ 2009-09-02 20:35:02.000000000 -0400 +++ minibuffer.el 2009-09-13 23:31:10.000000000 -0400 @@ -1670,28 +1670,32 @@ (unless (string-match re str) (error "Internal error: %s doesn't match %s" str re)) (let ((chopped ()) - (i 1)) - (while (match-beginning i) - (push (match-string i str) chopped) + (last 0) + (i 1) + next) + (while (setq next (match-end i)) + (push (substring str last next) chopped) + (setq last next) (setq i (1+ i))) ;; Add the text corresponding to the implicit trailing `any'. - (push (substring str (match-end 0)) chopped) + (push (substring str last) chopped) (push (nreverse chopped) ccs)))) ;; Then for each of those non-constant elements, extract the ;; commonality between them. - (let ((res ())) - ;; Make the implicit `any' explicit. We could make it explicit + (let ((res ()) + (fixed "")) + ;; Make the implicit trailing `any' explicit. We could make it explicit ;; everywhere, but it would slow down regexp-matching a little bit. (dolist (elem (append pattern '(any))) (if (stringp elem) - (push elem res) + (setq fixed (concat fixed elem)) (let ((comps ())) (dolist (cc (prog1 ccs (setq ccs nil))) (push (car cc) comps) (push (cdr cc) ccs)) - (let* ((prefix (try-completion "" comps)) - (unique (or (and (eq prefix t) (setq prefix "")) + (let* ((prefix (try-completion fixed comps)) + (unique (or (and (eq prefix t) (setq prefix fixed)) (eq t (try-completion prefix comps))))) (unless (equal prefix "") (push prefix res)) ;; If there's only one completion, `elem' is not useful @@ -1700,7 +1704,8 @@ ;; `any' into a `star' because the surrounding context has ;; changed such that string->pattern wouldn't add an `any' ;; here any more. - (unless unique (push elem res)))))) + (unless unique (push elem res)) + (setq fixed ""))))) ;; We return it in reverse order. res))))) From eli@barzilay.org Sun Sep 13 22:55:26 2009 Received: (at 4219) by emacsbugs.donarmstrong.com; 14 Sep 2009 05:55:26 +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.4 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8E5tPN5007734 for <4219@emacsbugs.donarmstrong.com>; Sun, 13 Sep 2009 22:55:26 -0700 Received: from eli by barzilay.org with local (Exim 4.66) (envelope-from ) id 1Mn4X6-0000uF-Jq; Mon, 14 Sep 2009 01:55:24 -0400 From: Eli Barzilay MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19117.56012.602721.600489@winooski.ccs.neu.edu> Date: Mon, 14 Sep 2009 01:55:24 -0400 To: Stefan Monnier Cc: 4219@debbugs.gnu.org Subject: Re: bug#4219: 23.1; case insensitive + partial completions In-Reply-To: References: X-Mailer: VM 8.0.12 under 23.1.1 (x86_64-unknown-linux-gnu) On Sep 13, Stefan Monnier wrote: > >>>>> "Eli" == Eli Barzilay writes: > > > INSTALL > > install-sh > > > Hit `C-x C-f ins TAB' -- it will be completed to "insTALL". > > I think the patch below will help out. You may still get such > inconsistent results in different parts of a completion > (e.g. completing "fo-ba" against "FOO-BAR" and "foo-bar" may return > "FOO-bar"), but at least the above case should be handled better. I had a hacked version of `PC-do-completion' which worked until v23 came out that did a proper case-insensitive match. In my version I'd never get "FOO-bar" for the above. Would it help to look at it? (It's been a while since I did it, and all I have a single comment at the top of that change saying: "If there are possibility prefixes that match the basestr exactly then replace the basestr part of prefix by the apropriate one". So I'm not sure if this can be helpful or not.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From lekktu@gmail.com Thu Oct 22 02:35:31 2009 Received: (at control) by emacsbugs.donarmstrong.com; 22 Oct 2009 09:35:32 +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.0 required=4.0 tests=AWL,MISSING_SUBJECT, MURPHY_DRUGS_REL8,NOSUBJECT,VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9M9ZTNW004084 for ; Thu, 22 Oct 2009 02:35:31 -0700 Received: by fxm9 with SMTP id 9so9696363fxm.1 for ; Thu, 22 Oct 2009 02:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=8EmqKmTQZFxRHmBqMf0mAHPBq3MFliknc0lztWoJq6Y=; b=HxQYupT4FFltZz1ItMJj0h3XTFYNK5e7ryT0Cek2T3YESYQLNQM8G9V9i2CKiMAEbc EvYuLj8f7w1qApk14qvzihjcYCGQUOU+1DBevO5UhGKLQhzQ6+vBiuihHNGFYaXeeEYe kJYg0CmwEGM5xp9e/Qz4pt4br7Ml4TcpNJkWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=Y5ybjjcxlLdLgAFAm7oQwPF4q6enZ/vhDgoBesbKLPsYfKZBy2gNxuVUArd1lZsA9C Mqc9bcUQhekOxrkhuBrM/oRLNjZDm8m0DPtCnEMhvvK6rKfs9H9j6QMJR6VObUwlfUeo 7VB35jQ8OYFrwvpcsbgPdQA8bmjmcb1XFRU14= MIME-Version: 1.0 Received: by 10.239.145.8 with SMTP id q8mr761204hba.122.1256204124158; Thu, 22 Oct 2009 02:35:24 -0700 (PDT) From: Juanma Barranquero Date: Thu, 22 Oct 2009 11:35:04 +0200 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 reassign 4326 emacs,ns merge 4261 4434 merge 1589 3359 4207 merge 3829 4077 tags 4781 + patch tags 4747 + patch tags 4579 + patch tags 4471 + patch tags 4434 + patch tags 4234 + patch tags 4221 + patch tags 4147 + patch tags 4144 + patch tags 4139 + patch tags 4023 + patch tags 4736 + moreinfo unreproducible tags 4547 + notabug tags 4451 + notabug tags 4448 + moreinfo tags 4427 + moreinfo tags 4373 + notabug tags 4360 + notabug tags 4271 + moreinfo tags 4236 + moreinfo tags 4143 + moreinfo unreproducible tags 4120 + moreinfo unreproducible tags 4070 + moreinfo unreproducible severity 4422 wishlist severity 4396 minor severity 4394 minor severity 4341 wishlist severity 4300 minor severity 4263 minor severity 4178 minor severity 4172 wishlist severity 4110 wishlist severity 4056 wishlist close 4772 close 4700 close 4599 close 4515 close 4463 close 4445 close 4395 close 4334 close 4289 close 4219 quit From unknown Sat Sep 20 12:49:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 19 Nov 2009 15:24:16 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator