Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 3.1.6-pws-2: _gv



Peter Stephenson wrote:

> Some typos crept into _gv (at least the one I have, which is the one you
> get).

Oops.

> Also, completion for configure failed when I used it via a path beginning
> with a ~.  Apparently something (_arguments, presumably) tried to append
> the current directory to the path, which didn't work awfully well.

Yep, the caching could be improved, but the problem here was that
there were too many double quotes and a missing tilde (to have the
tilde expanded).

> (By the way, Sven, now I've thought of it: when you generate new completion
> functions, could you use a directory name like Completion with a suffix
> rather than oc for the old directory, since patch -p0 prefers the shorter
> name and creates it in oc.  If you want to avoid having to type the whole
> of Completion..., I believe there are now shells which can help in this
> respect...)

Cool. Where can I get them?

(And, yes, I can do that.)

> *** Completion/User/_gv~	Mon Aug 30 16:18:56 1999

Why is this in `User', btw? ghostview without X doesn't seem to make
much sense to me (ghostscript without X is ok, though).

Bye
 Sven

P.S.: I don't need the smiley, yes?

diff -u Completion.old/Base/_arguments Completion/Base/_arguments
--- Completion.old/Base/_arguments	Wed Sep  1 14:24:49 1999
+++ Completion/Base/_arguments	Thu Sep  2 10:27:12 1999
@@ -43,10 +43,9 @@
       tmpargv=( "${(@)argv[1,nth-1]}" )
     fi
 
-    if [[ "$words[1]" = /* ]]; then
-      tmp="$words[1]"
-    else
-      tmp="$PWD/$words[1]"
+    tmp=${~words[1]}
+    if [[ "$tmp" != /* ]]; then
+      tmp="$PWD/$tmp"
     fi
 
     if [[ "$tmp" != "$_args_cache_longcmd" ]]; then
@@ -92,7 +91,7 @@
       # those hyphens and anything from the space or comma after the
       # option up to the end. 
 
-      lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$("$words[1]" --help 2>&1)//\[--/
+      lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(${~words[1]} --help 2>&1)//\[--/
 --}:#[ 	]#-*}//,/
 }}:#[ 	]#--*}#*--}%%[, ]*}:#}")
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author