* How to complete backquote, etc. using compsys?
@ 2001-08-21 20:41 Keijiro Ehara
2001-08-23 9:49 ` Oliver Kiddle
0 siblings, 1 reply; 4+ messages in thread
From: Keijiro Ehara @ 2001-08-21 20:41 UTC (permalink / raw)
To: zsh-users
Hi.
I was using compctl before but now i decided to use compsys.
When i use a little modified zsh-4.0.2/StartupFiles/zshrc as ~/.zshrc,
my zsh won't complete backquote and etc. like below.
pote% kill -HUP `cat /var/run/in[TAB]
pote% kill -HUP `cat /var/run/inetd.pid
With compctl, i got
pote% kill -HUP `cat /var/run/inetd.pid`
and, i expect it.
Is it just because i omit some option?
thanks.
popo@sfc.wide.ad.jp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to complete backquote, etc. using compsys?
2001-08-21 20:41 How to complete backquote, etc. using compsys? Keijiro Ehara
@ 2001-08-23 9:49 ` Oliver Kiddle
2001-08-23 18:01 ` Bart Schaefer
0 siblings, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2001-08-23 9:49 UTC (permalink / raw)
To: Keijiro Ehara; +Cc: zsh-users
Keijiro Ehara wrote:
> I was using compctl before but now i decided to use compsys.
> When i use a little modified zsh-4.0.2/StartupFiles/zshrc as ~/.zshrc,
> my zsh won't complete backquote and etc. like below.
>
> pote% kill -HUP `cat /var/run/in[TAB]
> pote% kill -HUP `cat /var/run/inetd.pid
>
> With compctl, i got
> pote% kill -HUP `cat /var/run/inetd.pid`
> and, i expect it.
>
> Is it just because i omit some option?
No, you didn't miss an option. The new completion system just doesn't
complete the backquote.
Incidentally, you could also write your above command as:
kill -HUP $(</var/run/inetd.pid)
Again, here it won't complete the closing bracket I'm afraid. $( ... )
is like backquotes but has some advantages and with the initial <, it
works like you used the cat command.
Suffix handling is the next area where changes are likely to take place
with the new completion system. This will probably take the form of
moving more of the context handling to shell code and allowing it to
handle more syntax constructs. At the moment, I don't think the shell
code can tell if it is in $( .. ) and we can't complete things like
history modifiers and glob qualifiers. You could probably actually
modify shell code (probably _main_complete) to complete the backquote
though.
Oliver
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to complete backquote, etc. using compsys?
2001-08-23 9:49 ` Oliver Kiddle
@ 2001-08-23 18:01 ` Bart Schaefer
2001-08-28 9:36 ` Oliver Kiddle
0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2001-08-23 18:01 UTC (permalink / raw)
To: Keijiro Ehara; +Cc: zsh-users
On Aug 23, 10:49am, Oliver Kiddle wrote:
}
} No, you didn't miss an option. The new completion system just doesn't
} complete the backquote. [...] At the moment, I don't think the shell
} code can tell if it is in $( .. )
Yes, it can tell that it's in $(...) or `...`. It doesn't complete the
trailing backtick or closing paren because there's no way to tell when
you're really at the end of the expression. How is it supposed to know
whether you mean
`cat /var/run/inetd.pid`
or whether you're going to go on with more of the command, as in
`cat /var/run/inetd.pid /var/run/sshd.pid`
or the like?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to complete backquote, etc. using compsys?
2001-08-23 18:01 ` Bart Schaefer
@ 2001-08-28 9:36 ` Oliver Kiddle
0 siblings, 0 replies; 4+ messages in thread
From: Oliver Kiddle @ 2001-08-28 9:36 UTC (permalink / raw)
To: zsh-users; +Cc: Keijiro Ehara
Bart Schaefer wrote:
>
> On Aug 23, 10:49am, Oliver Kiddle wrote:
> }
> } No, you didn't miss an option. The new completion system just doesn't
> } complete the backquote. [...] At the moment, I don't think the shell
> } code can tell if it is in $( .. )
>
> Yes, it can tell that it's in $(...) or `...`.
compstate[quote] and compstate[quoting] indicate if it is in `...` but
how can it tell it's in $(...)? The level of nesting would also be
useful.
> It doesn't complete the
> trailing backtick or closing paren because there's no way to tell when
> you're really at the end of the expression. How is it supposed to know
> whether you mean
> `cat /var/run/inetd.pid`
> or whether you're going to go on with more of the command, as in
> `cat /var/run/inetd.pid /var/run/sshd.pid`
> or the like?
That's true but it would be useful to have the backquote as a removable
suffix because it is quicker to press space than backquote. A style
could always be used to prevent it. Also, without multios the closing
bracket of $(<...) should always be completed.
Oliver
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-08-28 9:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-21 20:41 How to complete backquote, etc. using compsys? Keijiro Ehara
2001-08-23 9:49 ` Oliver Kiddle
2001-08-23 18:01 ` Bart Schaefer
2001-08-28 9:36 ` 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).