From unknown Fri Aug 15 14:17:27 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#1976 <1976@debbugs.gnu.org> To: bug#1976 <1976@debbugs.gnu.org> Subject: Status: 23.0.50; PC-do-completion should fix case if possible Reply-To: bug#1976 <1976@debbugs.gnu.org> Date: Fri, 15 Aug 2025 21:17:27 +0000 retitle 1976 23.0.50; PC-do-completion should fix case if possible reassign 1976 emacs submitter 1976 Denis Howe severity 1976 normal thanks From denis.howe@gmail.com Wed Jan 21 06:45:21 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Jan 2009 14:45: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.1 required=4.0 tests=FOURLA,GMAIL,MULTALT, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0LEjHkI002462 for ; Wed, 21 Jan 2009 06:45:18 -0800 Received: from mx10.gnu.org ([199.232.76.166]:57013) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LPeJ0-0008DB-7d for emacs-pretest-bug@gnu.org; Wed, 21 Jan 2009 09:43:46 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LPeKQ-0004zQ-0M for emacs-pretest-bug@gnu.org; Wed, 21 Jan 2009 09:45:16 -0500 Received: from mail-bw0-f10.google.com ([209.85.218.10]:45005) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPeKP-0004zA-2V for emacs-pretest-bug@gnu.org; Wed, 21 Jan 2009 09:45:13 -0500 Received: by bwz3 with SMTP id 3so234229bwz.18 for ; Wed, 21 Jan 2009 06:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kGYds7ECNK83YNSczDJHh59ocnKT0t43Y07c2u+6DzU=; b=xbZ/09oeXyaJwqb9C88MRDpeXcNrIN+5e13d+BgEQqaofIr0QUbcbIzfgA6J4QRYmk h5L4OAGLYZaRa5YbuzAbLOEX//fT/+MnhktcHcUllEA9UcFRyY4P0S8bFcglQ6FtE+os 3uLuQRSnmm00g5vPeOBKOWo7kBgNIorAdZ5/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=yHnYoxLB9kiDYKZI8lIoYvbRmAwfuF8KfRLqGgkXDfGuqxPbFCOcl41YAymhWWMiI1 LK98aAGOXvaXhVrhT+Ms7AxBf9IR2beo9gL2a7Ii8B2cMlXEZpCQOQRPIEpRzsNvTIyJ b37qxPjjn9OaDrn6IhIZemY3HbkTu0YNBDf84= MIME-Version: 1.0 Received: by 10.181.225.6 with SMTP id c6mr2911498bkr.207.1232548963665; Wed, 21 Jan 2009 06:42:43 -0800 (PST) In-Reply-To: References: Date: Wed, 21 Jan 2009 14:42:43 +0000 Message-ID: Subject: Re: 23.0.50; PC-do-completion should fix case if possible From: Denis Howe To: emacs-pretest-bug@gnu.org Content-Type: multipart/alternative; boundary=0016e6d460a725c8ff0460ff2b02 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) --0016e6d460a725c8ff0460ff2b02 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit My 2007-10-03 attempt to get this patch applied got no further than RMS's request for someone to DTRT. It took several hours of my time to debug and test, and the bug still bites me every time I re-install, so PLEASE could someone apply it? Thanks. ------------------------------------------------------------ In the latest complete.el from CVS (v1.94), function "PC-do-completion" fails to correct the case of the input being completed when: - "completion-ignore-case" is true and - "read-file-name-completion-ignore-case" is true and - all possible completions have the same case Ordinary completion preserves input case only where the potential completions differ in case. If they agree then ordinary completion changes the input case to that of the prefix. For example, evaluate: (partial-completion-mode 0) (setq completion-ignore-case t) (completing-read "Input: " '(("Den".1)("Denis".2)) nil t "d") Hitting TAB runs ordinary "minibuffer-complete" which completes "d" to "Den" (case corrected). Enable partial completion: (partial-completion-mode 1) Re-evaluate the above completing-read. Hitting TAB now runs "PC-complete" which completes "d" to "den" (fails to correct input case). I've tested the attached patch thoroughly. Please contact me if you want any more background on this. ------------------------------------------------------------ ChangeLog entry: 2009-01-21 Denis Howe * complete.el (PC-do-completion): Correct case when unambiguous. ------------------------------------------------------------ cvs diff -cw complete.el Index: complete.el =================================================================== RCS file: /sources/emacs/emacs/lisp/complete.el,v retrieving revision 1.94 diff -c -w -r1.94 complete.el *** complete.el 9 Jan 2009 04:44:19 -0000 1.94 --- complete.el 21 Jan 2009 14:21:17 -0000 *************** *** 737,744 **** (setq prefix (PC-try-completion (PC-chunk-after basestr skip) poss))) (let ((first t) i) - ;; Retain capitalization of user input even if - ;; completion-ignore-case is set. (if (eq mode 'word) (setq prefix (PC-chop-word prefix basestr))) (goto-char (+ beg (length dirname))) --- 737,742 ---- *************** *** 746,760 **** (setq i 0) ; index into prefix string (while (< i (length prefix)) (if (and (< (point) end) (eq (downcase (aref prefix i)) ! (downcase (following-char)))) ! ;; same char (modulo case); no action ! (forward-char 1) ! (if (and (< (point) end) (and (looking-at " ") (memq (aref prefix i) ! PC-delims-list))) ;; replace " " by the actual delimiter (progn (delete-char 1) (insert (substring prefix i (1+ i)))) --- 744,757 ---- (setq i 0) ; index into prefix string (while (< i (length prefix)) (if (and (< (point) end) + (or (eq (downcase (aref prefix i)) ! (downcase (following-char))) (and (looking-at " ") (memq (aref prefix i) ! PC-delims-list)))) ;; replace " " by the actual delimiter + ;; or input char by prefix char (progn (delete-char 1) (insert (substring prefix i (1+ i)))) *************** *** 766,772 **** (setq end (1- end)))) (setq improved t) (insert (substring prefix i (1+ i))) ! (setq end (1+ end))))) (setq i (1+ i))) (or pt (setq pt (point))) (looking-at PC-delim-regex)) --- 763,769 ---- (setq end (1- end)))) (setq improved t) (insert (substring prefix i (1+ i))) ! (setq end (1+ end)))) (setq i (1+ i))) (or pt (setq pt (point))) (looking-at PC-delim-regex)) ------------------------------------------------------------ End -- Denis Howe --0016e6d460a725c8ff0460ff2b02 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable My 2007-10-03 attempt to get this patch applied got no further than RMS'= ;s request for someone to DTRT.  It took several hours of my time to d= ebug and test, and the bug still bites me every time I re-install, so PLEAS= E could someone apply it?  Thanks.
------------------------------------------------------------
In the latest complete.el from CVS (v1.94), function "PC-do-comple= tion" fails to correct the case of the input being completed when:

- "completion-ignore-case" is true and
- "read-file-name-completion-ignore-case" is true and
- all possible completions have the same case

Ordinary completion preserves input case only where the potential completio= ns differ in case.  If they agree then ordinary completion changes the= input case to that of the prefix.

For example, evaluate:

(partial-completion-mode 0)
(setq completion-ignore-case t)
(completing-read "Input: " '(("Den".1)("Denis&= quot;.2)) nil t "d")

Hitting TAB runs ordinary "minibuffer-complete" which completes &= quot;d" to "Den" (case corrected).

Enable partial completion:

(partial-completion-mode 1)

Re-evaluate the above completing-read.

Hitting TAB now runs "PC-complete" which completes "d" = to "den" (fails to correct input case).

I've tested the attached patch thoroughly.  Please contact me if y= ou want any more background on this.

------------------------------------------------------------

ChangeLog entry:

2009-01-21  Denis Howe <den= is.howe@gmail.com>

       * complete.el (PC-do-completion): Correct case = when unambiguous.

------------------------------------------------------------

c= vs diff -cw complete.el
Index: complete.el
=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /sources/emacs/emacs/lisp/complete= .el,v
retrieving revision 1.94
diff -c -w -r1.94 complete.el
*** complete.e= l    9 Jan 2009 04:44:19 -0000    1.94
---= complete.el    21 Jan 2009 14:21:17 -0000
**************= *
*** 737,744 ****
           = ;    (setq prefix (PC-try-completion
                = ;     (PC-chunk-after basestr skip) poss)))
   =        (let ((first t) i)
-     =       ;; Retain capitalization of user input even if-           ;; completion-ignore-case i= s set.
            (if (eq mode = 'word)
               = (setq prefix (PC-chop-word prefix basestr)))
      =       (goto-char (+ beg (length dirname)))
--- 737,7= 42 ----
***************
*** 746,760 ****
     =             (setq i 0) ; inde= x into prefix string
                = ;  (while (< i (length prefix))
       =              (if (and (< (p= oint) end)
            &nbs= p;            (eq (downcase (aref p= refix i))
!             &nb= sp;              (do= wncase (following-char))))
!               &nbs= p;       ;; same char (modulo case); no action
= !               &nbs= p;       (forward-char 1)
!     =                = (if (and (< (point) end)
         = ;               &nbs= p;  (and (looking-at " ")
            &nb= sp;            =             &nb= sp;            =   (memq (aref prefix i)
!         &nb= sp;               &n= bsp;   PC-delims-list)))
        = ;              ;; replace= " " by the actual delimiter
       &= nbsp;              (progn=
                = ;        (delete-char 1)
    &nb= sp;               &n= bsp;   (insert (substring prefix i (1+ i))))
--- 744,757 ----
&n= bsp;               &= nbsp; (setq i 0) ; index into prefix string
      &n= bsp;           (while (< i (leng= th prefix))
                = ;    (if (and (< (point) end)
+    &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp; (or
             = ;            (eq (downcase (aref pr= efix i))
!          &n= bsp;            = ;            &n= bsp;            = ; (downcase (following-char)))
                = ;           (and (looking-at "= ")
          &nb= sp;            =             &nb= sp;            =     (memq (aref prefix i)
!     =             &nb= sp;            =             &nb= sp;            = PC-delims-list))))
           &= nbsp;          ;; replace " " = by the actual delimiter
+            &n= bsp;            = ;            &n= bsp; ;; or input char by prefix char
       &nb= sp;              (progn               &nb= sp;        (delete-char 1)
    &= nbsp;               =     (insert (substring prefix i (1+ i))))
***************
*** 766,772 ****
         &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;  (setq end (1- end))))
        &nb= sp;             (setq improved= t)
           &n= bsp;            = ;            &n= bsp;     (insert (substring prefix i (1+ i)))
! &nbs= p;               &nb= sp;   (setq end (1+ end)))))
                = ;    (setq i (1+ i)))
        &n= bsp;         (or pt (setq pt (point)))
&nb= sp;               &n= bsp; (looking-at PC-delim-regex))
--- 763,769 ----
   =             &nb= sp;            =             &nb= sp;        (setq end (1- end))))
                = ;      (setq improved t)
    &nb= sp;            =             &nb= sp;            (inse= rt (substring prefix i (1+ i)))
!      &nb= sp;            =             &nb= sp;       (setq end (1+ end))))
  &nb= sp;               &n= bsp; (setq i (1+ i)))
                = ;  (or pt (setq pt (point)))
        =           (looking-at PC-delim-regex))
------------------------------------------------------------
End

-- Denis Howe <denis.howe@gmail.com>
<= br> --0016e6d460a725c8ff0460ff2b02-- From monnier@iro.umontreal.ca Wed Jan 21 14:13:22 2009 Received: (at 1976) by emacsbugs.donarmstrong.com; 21 Jan 2009 22:13:23 +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.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from psavcns.com (Hsiamail.ps-av.com [207.138.179.125]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0LMDJD7018659 for <1976@emacsbugs.donarmstrong.com>; Wed, 21 Jan 2009 14:13:21 -0800 Received: from ceviche.home [64.213.79.190] by psavcns.com with ESMTP (SMTPD32-8.12) id ADF64AB30064; Wed, 21 Jan 2009 16:13:10 -0600 Received: by ceviche.home (Postfix, from userid 20848) id EAA78B400C; Wed, 21 Jan 2009 17:13:09 -0500 (EST) From: Stefan Monnier To: Denis Howe Cc: 1976@debbugs.gnu.org, emacs-pretest-bug@gnu.org Subject: Re: bug#1976: 23.0.50; PC-do-completion should fix case if possible Message-ID: References: Date: Wed, 21 Jan 2009 17:13:09 -0500 In-Reply-To: (Denis Howe's message of "Wed, 21 Jan 2009 14:42:43 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > My 2007-10-03 attempt to get this patch applied got no further than RMS's > request for someone to DTRT. It took several hours of my time to debug and > test, and the bug still bites me every time I re-install, so PLEASE could > someone apply it? Thanks. BTW, the default completion in Emacs-23 is very close to partial-completion-mode. More to the point, if you remove `basic' from `completion-styles', it should be pretty much identical except for the following known differences: - no style completion for file names. - M-x lch TAB doesn't know how to expand to `list-command-history'. And even if you don't remove `basic', the behavior is fairly close. Also it should fix the problem you're reporting and provides a few improvements. Since partial-completion-mode is slated for obsolescence (tho not marked obsolete yet), I'm interested to hear if you find some other missing feature. Stefan From denis.howe@gmail.com Wed Jan 21 15:09:54 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Jan 2009 23:09:55 +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.0 required=4.0 tests=HAS_BUG_NUMBER,MULTALT autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0LN9psu032604 for ; Wed, 21 Jan 2009 15:09:53 -0800 Received: from mail.gnu.org ([199.232.76.166]:47955 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LPmBI-0000XC-RF for emacs-pretest-bug@gnu.org; Wed, 21 Jan 2009 18:08:20 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LPmCk-0006UO-JN for emacs-pretest-bug@gnu.org; Wed, 21 Jan 2009 18:09:51 -0500 Received: from fg-out-1718.google.com ([72.14.220.158]:41009) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPmCk-0006UC-5C for emacs-pretest-bug@gnu.org; Wed, 21 Jan 2009 18:09:50 -0500 Received: by fg-out-1718.google.com with SMTP id l26so2008864fgb.30 for ; Wed, 21 Jan 2009 15:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=85eu4WfGTD5W1wie5OQXNBvh/d0tqaWG4aWJSq7/0qA=; b=rntTOpAm3vwJvs/JX5kMI2axOiPQBiH0+6iNT8iziO+PXGpcUhl71jSTMfTe9rqI8X QxJ9L3jVD0+fnGLVV8hXm4ZV8SzM3TZET1vOfVqIO+YTMXO//CVPD9UmX0UjcDHE0Z84 DvsTan5B9nZM1VwEL/467/EHaPEawHI0Mu7fw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ljX4ckKnfMx4pOQEkDXoDa9AjKVpAXlqjVp8uKNNGKOBxFPbP8Oa+001BgY4o7bFUx /hIEhQ7goy5lJDUOrfODRUD05nPfjW7J+vwIizMOxIrnl0fNzvvTRn35JbBz0Br+sJC1 Pkgnuix+lVaCIqteIFy7OUbGKaxi1s5nkEffU= MIME-Version: 1.0 Received: by 10.181.13.19 with SMTP id q19mr3063977bki.53.1232579388625; Wed, 21 Jan 2009 15:09:48 -0800 (PST) In-Reply-To: References: Date: Wed, 21 Jan 2009 23:09:48 +0000 Message-ID: Subject: Re: bug#1976: 23.0.50; PC-do-completion should fix case if possible From: Denis Howe To: Stefan Monnier Cc: 1976@debbugs.gnu.org, emacs-pretest-bug@gnu.org Content-Type: multipart/alternative; boundary=001636c5aace9dd1ff046106403d X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) --001636c5aace9dd1ff046106403d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/1/21 Stefan Monnier > the default completion in Emacs-23 is very close to partial-completion-mode OMG, so it is! I've been using partial-completion-mode so long I can't remember why I turned it on. What's even stupider is that I've never actually used the "partial" feature. Thanks very much for the enlightenment. --001636c5aace9dd1ff046106403d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2009/1/21 Stefan Monnier <<= a href=3D"mailto:monnier@iro.umontreal.ca">monnier@iro.umontreal.ca>=
the default completion in Emacs-23 is very close to partial-completion-mod= e
 
OMG, so it is!   I've been using= partial-completion-mode so long I can't remember why I turned it on.&n= bsp; What's even stupider is that I've never actually used the &quo= t;partial" feature.  Thanks very much for the enlightenment.
--001636c5aace9dd1ff046106403d-- From cyd@stupidchicken.com Wed Jan 28 07:35:35 2009 Received: (at 1976-done) by emacsbugs.donarmstrong.com; 28 Jan 2009 15:35:35 +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=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0SFZW3I030005 for <1976-done@emacsbugs.donarmstrong.com>; Wed, 28 Jan 2009 07:35:34 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 4AB7C57E20A; Wed, 28 Jan 2009 10:36:04 -0500 (EST) From: Chong Yidong To: Denis Howe Cc: 1976-done@debbugs.gnu.org Subject: Re: 23.0.50; PC-do-completion should fix case if possible Date: Wed, 28 Jan 2009 10:36:04 -0500 Message-ID: <87bptr1lzv.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > the default completion in Emacs-23 is very close to > > partial-completion-mode > > OMG, so it is! I've been using partial-completion-mode so long I > can't remember why I turned it on. What's even stupider is that I've > never actually used the "partial" feature. Thanks very much for the > enlightenment. In any case, I've checked in your patch to complete.el. Thanks. From unknown Fri Aug 15 14:17:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Thu, 26 Feb 2009 15:24:06 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log 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