unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14907: 24.3.50; Too few completions shown when case ignored
@ 2013-07-19 12:53 Stephen Berman
  2013-07-20  8:20 ` Stefan Monnier
  2013-07-30 20:42 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Berman @ 2013-07-19 12:53 UTC (permalink / raw)
  To: 14907

-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@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#14907: 24.3.50; Too few completions shown when case ignored
  2013-07-19 12:53 bug#14907: 24.3.50; Too few completions shown when case ignored Stephen Berman
@ 2013-07-20  8:20 ` Stefan Monnier
  2013-07-30 20:42 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2013-07-20  8:20 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 14907

> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#14907: 24.3.50; Too few completions shown when case ignored
  2013-07-19 12:53 bug#14907: 24.3.50; Too few completions shown when case ignored Stephen Berman
  2013-07-20  8:20 ` Stefan Monnier
@ 2013-07-30 20:42 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2013-07-30 20:42 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 14907-done

> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-30 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-19 12:53 bug#14907: 24.3.50; Too few completions shown when case ignored Stephen Berman
2013-07-20  8:20 ` Stefan Monnier
2013-07-30 20:42 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).