GNU bug report logs - #14907
24.3.50; Too few completions shown when case ignored

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Fri, 19 Jul 2013 12:54:02 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14907 in the body.
You can then email your comments to 14907 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14907; Package emacs. (Fri, 19 Jul 2013 12:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 19 Jul 2013 12:54:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Too few completions shown when case ignored
Date: Fri, 19 Jul 2013 14:53:17 +0200
-1. cd /tmp; touch a A
0. emacs -Q
1. M-x set-variable RET read-file-name-completion-ignore-case RET t RET
2. C-x C-f a TAB => [Complete, but not unique]
3. TAB => *Completions* buffer shows only file `a'.

Likewise, if at step 2 you type C-c C-f A TAB, then after the TAB in
step 3, *Completions* shows only file `A'.

If I debugged this correctly, the problem is due to completion--twq-all
not distinguishing between prefix strings for completions that differ
only in case.  The following patch fixes this problem for me (I tried to
reuse the relevant part of the requoting code, but haven't tested such
cases).

=== modified file 'lisp/minibuffer.el'
*** lisp/minibuffer.el	2013-05-30 03:18:06 +0000
--- lisp/minibuffer.el	2013-07-19 07:26:59 +0000
***************
*** 568,573 ****
--- 568,580 ----
                   (cl-assert (string-prefix-p prefix completion 'ignore-case) t)
                   (let* ((new (substring completion (length prefix)))
                          (qnew (funcall qfun new))
+  			(rest (substring completion 0 (length prefix)))
+ 			(qrest (funcall qfun rest))
+ 			;; Distinguish completions that differ only in case.
+  			(qprefix (if (completion--string-equal-p qprefix qrest)
+  				     (propertize qrest 'face
+  						 'completions-common-part)
+  				   qprefix))
                          (qcompletion (concat qprefix qnew)))
  		   ;; FIXME: Similarly here, Cygwin's mapping trips this
  		   ;; assertion.




In GNU Emacs 24.3.50.28 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4)
 of 2013-07-18 on rosalinde
Bzr revision: 113449 yamaoka <at> jpl.org-20130718112604-s5mf1r4odkd66rfe
Windowing system distributor `The X.Org Foundation', version 11.0.11203000
System Description:	openSUSE 12.2 (x86_64)

Configured using:
 `configure --without-toolkit-scroll-bars CFLAGS=-g3 -O0'

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14907; Package emacs. (Sat, 20 Jul 2013 08:21:02 GMT) Full text and rfc822 format available.

Message #8 received at 14907 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 14907 <at> debbugs.gnu.org
Subject: Re: bug#14907: 24.3.50; Too few completions shown when case ignored
Date: Sat, 20 Jul 2013 04:20:44 -0400
> If I debugged this correctly, the problem is due to completion--twq-all
> not distinguishing between prefix strings for completions that differ
> only in case.  The following patch fixes this problem for me (I tried to
> reuse the relevant part of the requoting code, but haven't tested such
> cases).

Thanks for the patch.  Will look at it ASAP (hopefully this week).


        Stefan




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Tue, 30 Jul 2013 20:43:02 GMT) Full text and rfc822 format available.

Notification sent to Stephen Berman <stephen.berman <at> gmx.net>:
bug acknowledged by developer. (Tue, 30 Jul 2013 20:43:03 GMT) Full text and rfc822 format available.

Message #13 received at 14907-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 14907-done <at> debbugs.gnu.org
Subject: Re: bug#14907: 24.3.50; Too few completions shown when case ignored
Date: Tue, 30 Jul 2013 16:42:02 -0400
> If I debugged this correctly, the problem is due to completion--twq-all
> not distinguishing between prefix strings for completions that differ
> only in case.  The following patch fixes this problem for me (I tried to
> reuse the relevant part of the requoting code, but haven't tested such
> cases).

Thanks.  It's probably not 100% sufficient in all cases, but I don't
know how to do it right, and it solves the 99% case.
I installed a slightly different version which skips the extra work if
ignore-case is not used.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Aug 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 296 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.