zsh-workers
 help / color / mirror / code / Atom feed
* Making built-in completion recognize : as word boundary
@ 2008-02-29 21:17 Matthias B.
  2008-02-29 21:23 ` Mikael Magnusson
  2008-03-01  0:37 ` Oliver Kiddle
  0 siblings, 2 replies; 10+ messages in thread
From: Matthias B. @ 2008-02-29 21:17 UTC (permalink / raw)
  To: zsh-workers

Something that's been bothering me for years now with zsh is that the
built-in completion can't complete

PATH=/usr/bin:/sb<TAB>

presumably because it doesn't consider the colon a word boundary. Could
someone please point me at the code responsible so that I can fix this.

MSB

p.s.: I know that the function-based completion system doesn't have this
problem, but I don't want to use it.

-- 
2+2=5, for moderately large values of two.


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

* Re: Making built-in completion recognize : as word boundary
  2008-02-29 21:17 Making built-in completion recognize : as word boundary Matthias B.
@ 2008-02-29 21:23 ` Mikael Magnusson
  2008-02-29 21:40   ` Matthias B.
  2008-03-01  0:37 ` Oliver Kiddle
  1 sibling, 1 reply; 10+ messages in thread
From: Mikael Magnusson @ 2008-02-29 21:23 UTC (permalink / raw)
  To: zsh-workers

On 29/02/2008, Matthias B. <msbREMOVE-THIS@winterdrache.de> wrote:
> Something that's been bothering me for years now with zsh is that the
>  built-in completion can't complete
>
>  PATH=/usr/bin:/sb<TAB>
>
>  presumably because it doesn't consider the colon a word boundary. Could
>  someone please point me at the code responsible so that I can fix this.
>
>  MSB
>
>  p.s.: I know that the function-based completion system doesn't have this
>  problem, but I don't want to use it.

path=(/usr/bin /sb<tab>
should work fine i think.

You can also make more of these automagic paired variables with some
argument to typeset.
typeset -T MYVAR myvar
myvar=(do re mi)
echo $MYVAR
do:re:mi

I know that doesn't answer your actual question, but maybe it's useful
as a workaround.

-- 
Mikael Magnusson


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

* Re: Making built-in completion recognize : as word boundary
  2008-02-29 21:23 ` Mikael Magnusson
@ 2008-02-29 21:40   ` Matthias B.
  0 siblings, 0 replies; 10+ messages in thread
From: Matthias B. @ 2008-02-29 21:40 UTC (permalink / raw)
  To: zsh-workers

On Fri, 29 Feb 2008 22:23:38 +0100 "Mikael Magnusson" <mikachu@gmail.com>
wrote:

> I know that doesn't answer your actual question, but maybe it's useful
> as a workaround.

Thanks, but the PATH and : issue was just an example. The same problem
happens with

program --file=/us<TAB>

and in other cases. zsh does not seem to take anything but whitespace as a
word boundary except for special cases such as variable assignment (e.g.
PATH=/us<TAB> works). I really want to fix this for good, but I don't feel
like digging through the complete source, so I'll need at least some
directions.

MSB

-- 
Ambition is a poor excuse for not having enough sense to be lazy.


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

* Re: Making built-in completion recognize : as word boundary
  2008-02-29 21:17 Making built-in completion recognize : as word boundary Matthias B.
  2008-02-29 21:23 ` Mikael Magnusson
@ 2008-03-01  0:37 ` Oliver Kiddle
  2008-03-01  6:06   ` Andrey Borzenkov
  2008-03-01 13:17   ` Matthias B.
  1 sibling, 2 replies; 10+ messages in thread
From: Oliver Kiddle @ 2008-03-01  0:37 UTC (permalink / raw)
  To: zsh-workers

"Matthias B." wrote:
> Something that's been bothering me for years now with zsh is that the
> built-in completion can't complete
> 
> PATH=/usr/bin:/sb<TAB>

Try:
  setopt magicequalsubst


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

* Re: Making built-in completion recognize : as word boundary
  2008-03-01  0:37 ` Oliver Kiddle
@ 2008-03-01  6:06   ` Andrey Borzenkov
  2008-03-01 13:17   ` Matthias B.
  1 sibling, 0 replies; 10+ messages in thread
From: Andrey Borzenkov @ 2008-03-01  6:06 UTC (permalink / raw)
  To: zsh-workers

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

On Saturday 01 March 2008, Oliver Kiddle wrote:
> 
> "Matthias B." wrote:
> > Something that's been bothering me for years now with zsh is that the
> > built-in completion can't complete
> > 
> > PATH=/usr/bin:/sb<TAB>
> 
> Try:
>   setopt magicequalsubst
> 

Well, as it works with "new" completion ouf-of-the-box, is there any reason to
use compctl now?

{pts/1}% print $options[magicequalsubst]
off
{pts/1}% PATH=/usr/bin:/sbTAB
{pts/1}% PATH=/usr/bin:/sbin/

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Making built-in completion recognize : as word boundary
  2008-03-01  0:37 ` Oliver Kiddle
  2008-03-01  6:06   ` Andrey Borzenkov
@ 2008-03-01 13:17   ` Matthias B.
  2008-03-01 19:08     ` Bart Schaefer
                       ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Matthias B. @ 2008-03-01 13:17 UTC (permalink / raw)
  To: zsh-workers

On Sat, 01 Mar 2008 01:37:02 +0100 Oliver Kiddle <okiddle@yahoo.co.uk>
wrote:

> "Matthias B." wrote:
> > Something that's been bothering me for years now with zsh is that the
> > built-in completion can't complete
> > 
> > PATH=/usr/bin:/sb<TAB>
> 
> Try:
>   setopt magicequalsubst

Doesn't help. Nor would I expect it to based on the documentation. It says
nothing about effects on TAB-completion.

On Sat, 1 Mar 2008 09:06:54 +0300 Andrey Borzenkov <arvidjaar@newmail.ru>
wrote:

> Well, as it works with "new" completion ouf-of-the-box, is there any
> reason to use compctl now?

Yes. The shell function based completion is slow (ever tried it on a
500MHz machine? That's what I'm writing this message on.) and more
importantly it's too complex for my taste. I don't want all those
completions and I
don't have the time to prune down the default set or start from scratch
to write my own. All I want is some decent filename completion.

MSB

-- 
I will continue to be an impossible person
as long as those who are now possible remain possible.


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

* Re: Making built-in completion recognize : as word boundary
  2008-03-01 13:17   ` Matthias B.
@ 2008-03-01 19:08     ` Bart Schaefer
  2008-03-08 14:21       ` Matthias B.
  2008-03-01 19:28     ` Clint Adams
  2008-03-02 11:31     ` Oliver Kiddle
  2 siblings, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 2008-03-01 19:08 UTC (permalink / raw)
  To: zsh-workers

On Mar 1,  2:17pm, Matthias B. wrote:
}
} > > PATH=/usr/bin:/sb<TAB>
} > 
} > Try:
} >   setopt magicequalsubst
} 
} Doesn't help. Nor would I expect it to based on the documentation. It says
} nothing about effects on TAB-completion.

Try:

	compctl -D -f -x 'W[0,*=*] N[-1,:]' -/

See also Misc/compctl-examples in the zsh source.


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

* Re: Making built-in completion recognize : as word boundary
  2008-03-01 13:17   ` Matthias B.
  2008-03-01 19:08     ` Bart Schaefer
@ 2008-03-01 19:28     ` Clint Adams
  2008-03-02 11:31     ` Oliver Kiddle
  2 siblings, 0 replies; 10+ messages in thread
From: Clint Adams @ 2008-03-01 19:28 UTC (permalink / raw)
  To: Matthias B.; +Cc: zsh-workers

On Sat, Mar 01, 2008 at 02:17:47PM +0100, Matthias B. wrote:
> Yes. The shell function based completion is slow (ever tried it on a
> 500MHz machine? That's what I'm writing this message on.) and more

I used it religiously on a 440MHz machine until last year.


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

* Re: Making built-in completion recognize : as word boundary
  2008-03-01 13:17   ` Matthias B.
  2008-03-01 19:08     ` Bart Schaefer
  2008-03-01 19:28     ` Clint Adams
@ 2008-03-02 11:31     ` Oliver Kiddle
  2 siblings, 0 replies; 10+ messages in thread
From: Oliver Kiddle @ 2008-03-02 11:31 UTC (permalink / raw)
  To: zsh-workers

"Matthias B." wrote:
> > Try:
> >   setopt magicequalsubst
> 
> Doesn't help. Nor would I expect it to based on the documentation. It says
> nothing about effects on TAB-completion.

Sorry, I was getting mixed up between colons and equals. It does affect
the shell function based completion for colons. I expect Bart's answer
will be more helpful.

> Yes. The shell function based completion is slow (ever tried it on a
> 500MHz machine? That's what I'm writing this message on.) and more

I regularly use it on a NAS box that is probably slower (600MHz, low
power, ARM-based) and I've used it on much slower machines in the past.
You can speed it up by cutting down the number of completers and by
configuring it in areas where you find it slow. However I appreciate
that there's a lot of complexity to learn about to do that.

Oliver


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

* Re: Making built-in completion recognize : as word boundary
  2008-03-01 19:08     ` Bart Schaefer
@ 2008-03-08 14:21       ` Matthias B.
  0 siblings, 0 replies; 10+ messages in thread
From: Matthias B. @ 2008-03-08 14:21 UTC (permalink / raw)
  To: zsh-workers

On Sat, 01 Mar 2008 11:08:18 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:

> Try:
> 
> 	compctl -D -f -x 'W[0,*=*] N[-1,:]' -/
> 
> See also Misc/compctl-examples in the zsh source.

Thanks a lot. The following seems to do what I want, namely enable file
completion after : and = anywhere on the command line.

compctl -D -f -x 'N[-1,:=]' -f

MSB

-- 
Democracy is when the people have the right to make the wrong choices.


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

end of thread, other threads:[~2008-03-08 14:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-29 21:17 Making built-in completion recognize : as word boundary Matthias B.
2008-02-29 21:23 ` Mikael Magnusson
2008-02-29 21:40   ` Matthias B.
2008-03-01  0:37 ` Oliver Kiddle
2008-03-01  6:06   ` Andrey Borzenkov
2008-03-01 13:17   ` Matthias B.
2008-03-01 19:08     ` Bart Schaefer
2008-03-08 14:21       ` Matthias B.
2008-03-01 19:28     ` Clint Adams
2008-03-02 11:31     ` Oliver Kiddle

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).