zsh-workers
 help / color / mirror / code / Atom feed
From: Adam Spiers <adam@spiers.net>
To: zsh-workers@sunsite.auc.dk
Subject: Re: _files vs _path_files discussion (old thread)
Date: Sat, 11 Mar 2000 22:22:25 +0000	[thread overview]
Message-ID: <20000311222225.A27795@thelonious.new.ox.ac.uk> (raw)
In-Reply-To: <199909170728.JAA01949@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Fri, Sep 17, 1999 at 09:28:26AM +0200

[digging up a very old thread]

Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote:
> 
> 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.

Does the new zstyle stuff now provide some kind of configurability to
solve this issue?  Here's a practical example of the issue, just to
make sure it's clear what I'm talking about:

Suppose I have, in the cwd, a file `foo.tar.gz' and a directory `foo'.
I type:

  $ tar zxf foo<TAB>

Currently, this immediately completes to `foo.tar.gz'.  But what if I
actually wanted to extract a .tar.gz from somewhere within the
directory foo?  According to _complete_help, _tar calls _tar_archive,
which calls _files, which generates the tags `globbed-files',
`directories', and `all-files'.

Presumably because some globbed-files were found, directories were not
added to the list of completions.  Is it possible to set some style
appropriately so that directories are listed immediately along with
tarballs?  I'm interested in a general solution which would apply to
all invocations of `_files -g ...'.

Incidentally, the more I understand of the new completion system, the
more I like it.  Sure, it's very intricate and takes a lot of getting
used to, but it seems to me that the various concepts have been
abstracted out in just the right way so as to allow completion
function writers maximum flexibility and convenience.  It's also great
that the end-user can just press TAB and instantly enjoy all this
power without worrying about how it works, and that there is so much
configurability available from zstyle.  Congratulations to everyone
involved, especially (needless to say) Sven!

Adam


  reply	other threads:[~2000-03-11 22:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-17  7:28 PATCH: _rpm tweaks (_files vs _path_files discussion) Sven Wischnowsky
2000-03-11 22:22 ` Adam Spiers [this message]
2000-03-12  0:18   ` _files vs _path_files discussion (old thread) 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
2000-03-13 13:07 Sven Wischnowsky
2000-03-13 17:54 ` Bart Schaefer

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=20000311222225.A27795@thelonious.new.ox.ac.uk \
    --to=adam@spiers.net \
    --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).