zsh-users
 help / color / mirror / code / Atom feed
* Case insensitive completion problems with cygwin
@ 2006-11-01 18:13 John Cooper
  2006-11-02 12:36 ` John Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: John Cooper @ 2006-11-01 18:13 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

[I'm using zsh 4.3.2 on Windows 2003 with cygwin]

If I run `zsh -f' file completion works as expected in all the
following:

$ ls /c/<TAB>
$ ls /C/<TAB>
$ ls c:/<TAB>
$ ls C:/<TAB>

However, after running the following:
  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  autoload -U compinit
  compinit -C

$ ls /c/<TAB>   # fails - no completions are listed
$ ls /C/<TAB>   # works as expected
$ ls c:/<TAB>   # fails - no completions are listed
$ ls C:/<TAB>   # works as expected


I've found I can work around the problem by adding a '' to the above
matcher-list, namely:
  zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'

However, this isn't really the behavior I'd like as the following will
no longer
automatically complete both uppercase and lowercase matches. So if I now
type
the following:
$ ls /c/p<TAB>

.. it will no longer list "/c/Program\ Files" as one of the completion
matches,
and I have to manually hit backspace and change to an uppercase "P".

So, if I revert to the original matcher-list and try messing with
fake-files:
  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  zstyle ':completion:*' fake-files '/:c g h l r w z'

.. I then get the desired behavior where the following lists all files
beginning with 'p' or 'P':
$ ls /c/p<TAB>

However, now the following no longer works:

$ ls c:/<TAB>  # fails - no completions are listed


Is there a way to get true case-insensitive completion working for both
/c/ and
c:/ as a prefix?

Thanks,

    --- John


[-- Attachment #2: Type: text/html, Size: 5125 bytes --]

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

* RE: Case insensitive completion problems with cygwin
  2006-11-01 18:13 Case insensitive completion problems with cygwin John Cooper
@ 2006-11-02 12:36 ` John Cooper
  2006-11-02 13:05   ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: John Cooper @ 2006-11-02 12:36 UTC (permalink / raw)
  To: John Cooper, zsh-users

After a fair bit of trial-and-error I've found the following settings seem to achieve the desired result:

  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  zstyle ':completion:*:paths' accept-exact 'c:' 'b:' 'w:' 'r:' 'v:'
  zstyle ':completion:*' fake-files '/:c' '/:b' '/:w' '/:r' '/:v'

That is, I now get case-insensitive completion for all the following:
$ ls /c/p<TAB>
$ ls /C/p<TAB>
$ ls c:/p<TAB>
$ ls C:/p<TAB>

Assuming this is a recommended approach, perhaps a candidate for the FAQ?

(Btw, I've used cygwin's `mount -c' to change the cygdrive prefix to '/' rather than the default '/cygdrive', so that my drives appears as '/c', '/v', etc rather than the more usual '/cygdrive/c', '/cygdrive/v', etc.)

    --- John. 
________________________________________
From: John Cooper [mailto:john.cooper@eu.citrix.com] 
Sent: 01 November 2006 18:13
To: zsh-users@sunsite.dk
Subject: Case insensitive completion problems with cygwin

[I'm using zsh 4.3.2 on Windows 2003 with cygwin]
If I run `zsh -f' file completion works as expected in all the following:
$ ls /c/<TAB>
$ ls /C/<TAB>
$ ls c:/<TAB>
$ ls C:/<TAB>
However, after running the following:
  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  autoload -U compinit
  compinit -C
$ ls /c/<TAB>   # fails - no completions are listed
$ ls /C/<TAB>   # works as expected
$ ls c:/<TAB>   # fails - no completions are listed
$ ls C:/<TAB>   # works as expected

I've found I can work around the problem by adding a '' to the above matcher-list, namely:
  zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'
However, this isn't really the behavior I'd like as the following will no longer
automatically complete both uppercase and lowercase matches. So if I now type
the following:
$ ls /c/p<TAB>
.. it will no longer list "/c/Program\ Files" as one of the completion matches,
and I have to manually hit backspace and change to an uppercase "P".
So, if I revert to the original matcher-list and try messing with fake-files:
  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  zstyle ':completion:*' fake-files '/:c g h l r w z'
.. I then get the desired behavior where the following lists all files
beginning with 'p' or 'P':
$ ls /c/p<TAB>
However, now the following no longer works:
$ ls c:/<TAB>  # fails - no completions are listed

Is there a way to get true case-insensitive completion working for both /c/ and
c:/ as a prefix?
Thanks,
    --- John


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

* Re: Case insensitive completion problems with cygwin
  2006-11-02 12:36 ` John Cooper
@ 2006-11-02 13:05   ` Peter Stephenson
  2006-11-02 13:45     ` John Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2006-11-02 13:05 UTC (permalink / raw)
  To: zsh-users

"John Cooper" wrote:
> After a fair bit of trial-and-error I've found the following settings seem =
> to achieve the desired result:
> 
>   zstyle ':completion:*' matcher-list 'm:{a-z}=3D{A-Z}'
>   zstyle ':completion:*:paths' accept-exact 'c:' 'b:' 'w:' 'r:' 'v:'
>   zstyle ':completion:*' fake-files '/:c' '/:b' '/:w' '/:r' '/:v'
> 
> That is, I now get case-insensitive completion for all the following:
> $ ls /c/p<TAB>
> $ ls /C/p<TAB>
> $ ls c:/p<TAB>
> $ ls C:/p<TAB>
> 

This is certainly useful.  Have you "setopt nocaseglob"?

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


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

* RE: Case insensitive completion problems with cygwin
  2006-11-02 13:05   ` Peter Stephenson
@ 2006-11-02 13:45     ` John Cooper
  0 siblings, 0 replies; 4+ messages in thread
From: John Cooper @ 2006-11-02 13:45 UTC (permalink / raw)
  To: Peter Stephenson, zsh-users

Yes, I have "setopt nocaseglob" as well.

    --- John.

-----Original Message-----
From: Peter Stephenson [mailto:pws@csr.com] 
Sent: 02 November 2006 13:06
To: zsh-users@sunsite.dk
Subject: Re: Case insensitive completion problems with cygwin 

"John Cooper" wrote:
> After a fair bit of trial-and-error I've found the following settings
seem =
> to achieve the desired result:
> 
>   zstyle ':completion:*' matcher-list 'm:{a-z}=3D{A-Z}'
>   zstyle ':completion:*:paths' accept-exact 'c:' 'b:' 'w:' 'r:' 'v:'
>   zstyle ':completion:*' fake-files '/:c' '/:b' '/:w' '/:r' '/:v'
> 
> That is, I now get case-insensitive completion for all the following:
> $ ls /c/p<TAB>
> $ ls /C/p<TAB>
> $ ls c:/p<TAB>
> $ ls C:/p<TAB>
> 

This is certainly useful.  Have you "setopt nocaseglob"?

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:
http://www.csr.com/email_sig.php


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

end of thread, other threads:[~2006-11-02 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-01 18:13 Case insensitive completion problems with cygwin John Cooper
2006-11-02 12:36 ` John Cooper
2006-11-02 13:05   ` Peter Stephenson
2006-11-02 13:45     ` John Cooper

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).