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#1976: marked as done (23.0.50; PC-do-completion should fix case if possible) Date: Wed, 28 Jan 2009 15:45:05 +0000 Message-ID: References: <87bptr1lzv.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1233157505-31437-0" X-Trace: ger.gmane.org 1233158713 32200 80.91.229.12 (28 Jan 2009 16:05:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2009 16:05:13 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 17:06:26 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 1LSCuS-0002Mm-Hb for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 17:05:50 +0100 Original-Received: from localhost ([127.0.0.1]:34631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSCt9-0005A2-VS for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 11:03:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSCt3-00059o-TO for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 11:03:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSCt3-00059W-6N for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 11:03:33 -0500 Original-Received: from [199.232.76.173] (port=49048 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSCt2-00059T-Uu for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 11:03:32 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:49614) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LSCt1-00039G-TQ for bug-gnu-emacs@gnu.org; Wed, 28 Jan 2009 11:03:32 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0SG3Tws003669; Wed, 28 Jan 2009 08:03:30 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0SFj5Jk031488; Wed, 28 Jan 2009 07:45:05 -0800 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 1976 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:24685 Archived-At: This is a multi-part message in MIME format... ------------=_1233157505-31437-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Wed, 28 Jan 2009 10:36:04 -0500 with message-id <87bptr1lzv.fsf@cyd.mit.edu> and subject line Re: 23.0.50; PC-do-completion should fix case if possible has caused the Emacs bug report #1976, regarding 23.0.50; PC-do-completion should fix case if possible 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 1976: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D1976 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1233157505-31437-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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-- ------------=_1233157505-31437-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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@emacsbugs.donarmstrong.com 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. ------------=_1233157505-31437-0--