zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: quiet _path_files
@ 2000-02-25 15:51 Sven Wischnowsky
  0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-02-25 15:51 UTC (permalink / raw)
  To: zsh-workers


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-02-25 15:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-25 15:51 PATCH: quiet _path_files Sven Wischnowsky

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