zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: Re: PATCH: _rpm tweaks (_files vs _path_files discussion)
Date: Thu, 16 Sep 1999 18:08:40 +0200	[thread overview]
Message-ID: <9909161608.AA31314@ibmth.df.unipi.it> (raw)
In-Reply-To: "Adam Spiers"'s message of "Thu, 16 Sep 1999 17:03:07 DFT." <19990916170307.A17563@thelonious.new.ox.ac.uk>

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 

It is a bit of a problem.  The real trouble is _files is too generic; if it
fails, it doesn't know what it should try next.  Often, as in this case, it
should try directories, but sometimes, for example looking for tar archives
with a non-standard suffix, it's useful to get everything.  This depends
on where you are completing.

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.

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.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-09-16 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-16 16:03 Adam Spiers
1999-09-16 16:08 ` Peter Stephenson [this message]
1999-09-17  7:28 Sven Wischnowsky

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=9909161608.AA31314@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --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).