zsh-workers
 help / color / mirror / code / Atom feed
* Re: _path_files -W change
@ 1999-12-06  9:28 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-12-06  9:28 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> This used to work.  Has it officially stopped?  MH folder completion
> currently won't work because of it.  That can be trivially changed if the
> new behaviour is correct.
> 
> foopath=~/Mail
> compdef _foo foo
> foo() { _path_files -W foopath -/ }
> foo <TAB>
> 
> used to expand $foopath and complete directories, now doesn't.

It got confused because there wasn't a trailing slash. This patch
should make this as convenient as possible, i.e. the -W paths may or
may not have a trailing slash.

Bye
 Sven

diff -u -r oldcompletion/Core/_path_files Completion/Core/_path_files
--- oldcompletion/Core/_path_files	Fri Dec  3 16:42:42 1999
+++ Completion/Core/_path_files	Mon Dec  6 10:26:28 1999
@@ -39,10 +39,10 @@
          ;;
   W)     tmp1="$OPTARG"
          if [[ "$tmp1[1]" = '(' ]]; then
-           prepaths=( ${^=tmp1[2,-2]}/ )
+           prepaths=( ${^=tmp1[2,-2]%/}/ )
          else
-           prepaths=( ${(P)=${tmp1}} )
-           (( ! $#prepaths )) && prepaths=( ${tmp1}/ )
+           prepaths=( ${(P)^=tmp1%/}/ )
+           (( ! $#prepaths )) && prepaths=( ${tmp1%/}/ )
          fi
          (( ! $#prepaths )) && prepaths=( '' )
          ;;

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* _path_files -W change
@ 1999-12-03 20:41 Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1999-12-03 20:41 UTC (permalink / raw)
  To: Zsh hackers list

This used to work.  Has it officially stopped?  MH folder completion
currently won't work because of it.  That can be trivially changed if the
new behaviour is correct.

foopath=~/Mail
compdef _foo foo
foo() { _path_files -W foopath -/ }
foo <TAB>

used to expand $foopath and complete directories, now doesn't.

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-12-06  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-06  9:28 _path_files -W change Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1999-12-03 20:41 Peter Stephenson

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