* zstyle & variables
@ 2006-01-17 13:14 Wataru Kagawa
2006-01-17 13:57 ` Peter Stephenson
0 siblings, 1 reply; 3+ messages in thread
From: Wataru Kagawa @ 2006-01-17 13:14 UTC (permalink / raw)
To: zsh-users
Hi all.
I have the following completion set in my zsh environment setup file.
zstyle ':completion:*' users $USERS
I also have a custom function to alter the contents of $USERS .
After running this function to change the contents of $USERS, I need
to execute the line above in the command line to make the change take
effect. I would like my custom function to do this for me, but I am
having trouble figuring it out. I tried adding, 'zstyle
':completion:*' users $USERS' to the bottom of my custom function,
but that did not work for me.
I hope someone can help me out.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: zstyle & variables
2006-01-17 13:14 zstyle & variables Wataru Kagawa
@ 2006-01-17 13:57 ` Peter Stephenson
2006-01-17 14:07 ` Wataru Kagawa
0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2006-01-17 13:57 UTC (permalink / raw)
To: zsh-users
Wataru Kagawa wrote:
> Hi all.
> I have the following completion set in my zsh environment setup file.
>
> zstyle ':completion:*' users $USERS
>
> I also have a custom function to alter the contents of $USERS .
> After running this function to change the contents of $USERS, I need
> to execute the line above in the command line to make the change take
> effect. I would like my custom function to do this for me, but I am
> having trouble figuring it out. I tried adding, 'zstyle
> ':completion:*' users $USERS' to the bottom of my custom function,
> but that did not work for me.
The easiest way to do this (I'm assuming USERS is an array) is to define
the style initially as:
zstyle -e ':completion:*' users 'reply=($USERS)'
This means that $USERS is examined every time the style is checked. So
when you modify the array it takes effect immediately.
--
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.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: zstyle & variables
2006-01-17 13:57 ` Peter Stephenson
@ 2006-01-17 14:07 ` Wataru Kagawa
0 siblings, 0 replies; 3+ messages in thread
From: Wataru Kagawa @ 2006-01-17 14:07 UTC (permalink / raw)
To: Peter Stephenson; +Cc: zsh-users
Hi Peter,
Thanks so much.
Wataru Kagawa
On 2006/01/17, at 22:57, Peter Stephenson wrote:
> Wataru Kagawa wrote:
>> Hi all.
>> I have the following completion set in my zsh environment setup file.
>>
>> zstyle ':completion:*' users $USERS
>>
>> I also have a custom function to alter the contents of $USERS .
>> After running this function to change the contents of $USERS, I need
>> to execute the line above in the command line to make the change take
>> effect. I would like my custom function to do this for me, but I am
>> having trouble figuring it out. I tried adding, 'zstyle
>> ':completion:*' users $USERS' to the bottom of my custom function,
>> but that did not work for me.
>
> The easiest way to do this (I'm assuming USERS is an array) is to
> define
> the style initially as:
>
> zstyle -e ':completion:*' users 'reply=($USERS)'
>
> This means that $USERS is examined every time the style is
> checked. So
> when you modify the array it takes effect immediately.
>
> --
> 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.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-17 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17 13:14 zstyle & variables Wataru Kagawa
2006-01-17 13:57 ` Peter Stephenson
2006-01-17 14:07 ` Wataru Kagawa
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).