From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Sven Wischnowsky <wischnow@berkom.de>, zsh-workers@sunsite.dk
Subject: Re: Redirection completion
Date: Mon, 11 Mar 2002 16:56:07 +0000 [thread overview]
Message-ID: <1020311165607.ZM27129@candle.brasslantern.com> (raw)
In-Reply-To: <15500.40522.132670.814408@wischnow.berkom.de>
On Mar 11, 1:08pm, Sven Wischnowsky wrote:
}
} Peter Stephenson wrote:
}
} > if I'm in some generic form of redirection completion I can still check
} > for `-redirect-echo-2>' in pattern-files, or does the context still just
} > look like `-redirect-2>' or `-redirect--default-'?
}
} But I'm not really sure which string to prefer in each case. I'd
} prefer the most specific one, i.e. `-redirect-echo-2>' in this case.
} Would that be ok for our users if we document it?
I think using the most-specific is fine, but I'd like to request a change
in the format.
Firstly I'd like to keep the "flavor" of redirection tightly associated
with the word `redirect', i.e. rather than
-redirect-echo-2>
It should be
-redirect-2>-echo
Then, I think, it would not be necessary to try each of `-redirect-',
`-redirect-2>', and `-redirect-2>-echo' in turn, because styles could be
written easily with wildcards e.g. `-redirect-*' or `-redirect-2>*'.
Unless I'm missing something about why all three are tried?
This points up the second change I'd like to request: Make this style
fragment work the same way that styles in general work, e.g., define a
fixed set of delimiter-separated segments and have them always be there
even if sometimes empty. E.g. supposing we switched to comma as the
delimiter, as Sven tossed out in one of the earlier messages on this
thread, the context would look like `-redirect-,2>,echo' and if for some
reason the command name were not known it would be `-redirect-,2>,'.
I suppose strictly speaking the first of those commas could be omitted
because we must always know what redirection operator we're dealing with
(else we wouldn't be in -redirect- context at all), e.g. `-redirect-2>,'.
Random additional comments:
If we do stick with hyphens, what does the context look like in the case
of completion after:
zsh% - 2>
(It's perfectly legal syntax to put the redirection anywhere on the line,
even before the command for which the precommand modifier is intended.)
If we instead switch to commas, what do we do in case of a command named
`,'? (I knew people in grad school who used a csh script named that, for
reasons too obscure to go into). On a similar note, do we need to fix
somehow the existing contexts for completing after the `:' command?
Different tack: If I have
zsh% ls >
with the cursor positioned ON the `>', what context(s) get tried when I
press TAB? I might expect it to complete file descriptor numbers ...
and in that case, I'd want to complete only the numbers of *valid* file
descriptors, but those aren't available to shell functions (yet).
--
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
next prev parent reply other threads:[~2002-03-11 16:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-08 12:33 Peter Stephenson
2002-03-08 12:54 ` Sven Wischnowsky
2002-03-08 14:06 ` Peter Stephenson
2002-03-08 14:10 ` Sven Wischnowsky
2002-03-11 8:42 ` Sven Wischnowsky
2002-03-11 9:58 ` Sven Wischnowsky
2002-03-11 10:54 ` Peter Stephenson
2002-03-11 11:16 ` Sven Wischnowsky
2002-03-11 11:29 ` Peter Stephenson
2002-03-11 12:08 ` Sven Wischnowsky
2002-03-11 14:01 ` Peter Stephenson
2002-03-11 16:56 ` Bart Schaefer [this message]
2002-03-12 9:03 ` Sven Wischnowsky
2002-03-12 13:16 ` Oliver Kiddle
2002-03-13 9:25 ` Sven Wischnowsky
2002-03-13 16:55 ` Peter Stephenson
2002-03-14 12:03 ` Sven Wischnowsky
2002-03-13 17:58 ` Oliver Kiddle
2002-03-13 18:19 ` Bart Schaefer
2002-03-14 13:51 ` Oliver Kiddle
2002-03-14 14:41 ` Peter Stephenson
2002-03-14 14:43 ` Sven Wischnowsky
2002-03-08 13:20 ` Oliver Kiddle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1020311165607.ZM27129@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=wischnow@berkom.de \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).