From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: quiet _path_files
Date: Fri, 25 Feb 2000 16:51:24 +0100 (MET) [thread overview]
Message-ID: <200002251551.QAA26294@beta.informatik.hu-berlin.de> (raw)
Until now, _path_files printed ugly error messages when completing
after ~foo/<TAB> where ~foo was neither a known user nor a named
directory. This makes it display a message, just like _tilde_files.
Or should we make them completely quiet?
Bye
Sven
diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files Fri Feb 25 14:17:21 2000
+++ Completion/Core/_path_files Fri Feb 25 16:47:29 2000
@@ -172,9 +172,19 @@
# prefix from the string to complete, set `donepath' to build the correct
# paths and make sure that the loop below is run only once with an empty
# prefix path by setting `prepaths'.
-
- linepath="${pre%%/*}/"
- realpath=$~linepath
+
+ linepath="${pre[2,-1]%%/*}"
+ if [[ -z "$linepath" ]]; then
+ realpath="${HOME%/}/"
+ elif (( $+userdirs[$linepath] )); then
+ realpath="${userdirs[$linepath]%/}/"
+ elif (( $+nameddirs[$linepath] )); then
+ realpath="${nameddirs[$linepath]%/}/"
+ else
+ _message "unknown user \`$linepath'"
+ return 1
+ fi
+ linepath="~${linepath}/"
[[ "$realpath" = "$linepath" ]] && return 1
pre="${pre#*/}"
orig="${orig#*/}"
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~2000-02-25 15:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200002251551.QAA26294@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.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).