zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: _rpm tweaks (_files vs _path_files discussion)
@ 1999-09-17  7:28 Sven Wischnowsky
  2000-03-11 22:22 ` _files vs _path_files discussion (old thread) Adam Spiers
  2000-03-12 13:02 ` Adam Spiers
  0 siblings, 2 replies; 12+ messages in thread
From: Sven Wischnowsky @ 1999-09-17  7:28 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> Adam Spiers wrote:
> > Now people may disagree with this, but I would have thought that in
> > many completion scenarios, _path_files -/ -g <glob> is more
> > appropriate than _files -g <glob>.  For example, when completing tar
> > archives, if there are none in directory foo, and you type 
> 
> ...
> 
> A second issue is whether, if you find target files in the current
> directory, you might still want to complete directories.  This is also hard
> to generalise on, since if you are completing a common enough file type you
> might very well want to be offered directories straight away, while if
> there aren't many of that type they may just get in the way.  But probably
> we need to be more consistent, rather than depending on who happened to
> write the completion file.

That's certainly right. I was worried about all these `-g' things I
added, too, and only thought about adding a config key that would be
used in all those places where we now use `-g'. I didn't think about:

> It's not a perfect solution, but we could have an argument to _files saying
> search only for directories if nothing found, not everything else, and a
> completion key saying whether, if that flag is passed, you want directories
> included in the list with the other files.  For example,
> _files -g <glob> + -/ (hey, this gives me the idea for another type of
> completion interface :-/), and the configuration option
> path_merge_alternatives, or something shorter.

This sounds good.

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 12+ messages in thread
* PATCH: _rpm tweaks (_files vs _path_files discussion)
@ 1999-09-16 16:03 Adam Spiers
  1999-09-16 16:08 ` Peter Stephenson
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Spiers @ 1999-09-16 16:03 UTC (permalink / raw)
  To: zsh workers mailing list

Now people may disagree with this, but I would have thought that in
many completion scenarios, _path_files -/ -g <glob> is more
appropriate than _files -g <glob>.  For example, when completing tar
archives, if there are none in directory foo, and you type 

  % tar zxf foo/<TAB>

getting a list of all files in the directory is fairly undesirable,
no?

Another case is completing *.spec and *.rpm files with _rpm, which
irritated me enough to provide a patch :-)

It's a matter of taste I suppose, but I'd be interested to hear
whether I'm alone on this.

Index: Completion/Linux/_rpm
diff -u Completion/Linux/_rpm:1.1.1.2 Completion/Linux/_rpm:1.2
--- Completion/Linux/_rpm:1.1.1.2	Thu Sep 16 12:39:44 1999
+++ Completion/Linux/_rpm	Thu Sep 16 13:00:22 1999
@@ -148,7 +148,7 @@
       '*:RPM package:->package' && ret=0
     ;;
   build_b)
-    tmp=( '*:spec file:_files -g \*.spec' )
+    tmp=( '*:spec file:_path_files -/ -g \*.spec' )
     ;&
   build_t)
     (( $#tmp )) || tmp=( '*:tar file:_files -g \*.\(\#i\)tar\(.\*\|\)' )
@@ -195,7 +195,7 @@
       _hosts -S/ && ret=0
     else
       _description expl 'RPM package file'
-      _files "$expl[@]" -g '*.(#i)rpm' && ret=0
+      _path_files "$expl[@]" -/ -g '*.(#i)rpm' && ret=0
       _description expl 'ftp URL prefix'
       compadd "$expl[@]" ftp://
     fi


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

end of thread, other threads:[~2000-03-12 22:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-17  7:28 PATCH: _rpm tweaks (_files vs _path_files discussion) Sven Wischnowsky
2000-03-11 22:22 ` _files vs _path_files discussion (old thread) Adam Spiers
2000-03-12  0:18   ` Bart Schaefer
2000-03-12  0:51     ` Adam Spiers
2000-03-12  6:21       ` Bart Schaefer
2000-03-12  6:34         ` Bart Schaefer
2000-03-12 13:02 ` Adam Spiers
2000-03-12 19:43   ` Bart Schaefer
2000-03-12 20:14     ` Adam Spiers
2000-03-12 22:51       ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1999-09-16 16:03 PATCH: _rpm tweaks (_files vs _path_files discussion) Adam Spiers
1999-09-16 16:08 ` 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).