From: Paul Seyfert <pseyfert@mathphys.fsk.uni-heidelberg.de>
To: Zsh Users <zsh-users@zsh.org>
Subject: avoiding duplications when using _path_files in completion function
Date: Sat, 19 Nov 2016 13:26:13 +0100 [thread overview]
Message-ID: <59f455d8-de16-b735-ba37-8b3f1f0be5b2@mathphys.fsk.uni-heidelberg.de> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi,
I'm writing a zsh tab completion function for a program which should get
started as:
PROGRAM INPUTFILE1 INPUTFILE2 [possibly more input files]
Typically one doesn't want to provide a file twice, so in a directory
with two files
cumbersome_long_5_filename.extension
cumbersome_long_X_filename.extension
i want to only suggest files which don't occur in the current line
already:
PROGRAM cumbersome_lone_5_filename.extension <TAB>
- -> suggest only cumbersome_lone_X_filename.extension
I imagine this is desired in other places as well and solutions exist.
So far I'm using (after some if for other use cases and non-filename
suggestions)
_path_files -g '*(/) *.extension'
which does suggest files several times.
I tried the -F option (for testing when suggesting the second filename,
providing the first filename to -F):
_path_files -F "$words[2]" -g '*(/) *.extension'
but this keeps suggesting the first file a second time (in zsh 5.2).
Any suggestions?
Thanks in advance,
Paul
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJYMETlAAoJEPOmP9OjPXmrOXMP+wSrMkmWaQGOqgAKo3sTBq5W
DgLJBOgqYVfYXgDn5hx98sIuytVigI2rjHBOn6AnZhNqgFhIjIy6YmshJ6bHsLX6
2y23BuBlkuiNUW95WmMK4KAG9Ucov7oYIPPKZE9OTFzODnE75SJjZCSi+R57DusA
9L5pd/Rd0W6quy3qTcZsCVutroiRImf/LG8IHBXKnHWekidZAkrZdLakObDEkiX/
wwFrAhvCskxS4z6UfayUebnKUKsV20hRl4KzIG5BGbjXkuo+DIv7hfnkA5beJic9
6JObYdoc/j1RROddAOQkNeWUP4pJwjoOM3nOxQu7XkjSnozoH2mqIBlSXn6vIzsi
6W82DP+KGuOkHmHu/HuR5vYt3HtejPltP8NOJFbjiMp4thFlRE67xLmOPVjA92Uy
kfN1L5aZDzgaMDENg9moxmnsGmeYzfvh5Cw+gwGVLPoamT11/RjUC1NsjwLnfAjn
PrNQzL5cUZUhFfr6t2bLeIXeATPm24WuSy7XDy3pY1TvohPEEvacakmfybgQbJ+/
oOg7NDFPW8jPy1XyvuBdEP596ORqANzPm6iHiyPGXIl788qWbe0usLw58yZ23ZSd
Fv+wQhNziqBYdKqlu1Zx/Hg9XJ+1x0ALeswJkOtIbpO9gPE/r9R6YA14kAIuPfI4
pXaLucrse+5Nu+0QeY2r
=OMx6
-----END PGP SIGNATURE-----
next reply other threads:[~2016-11-19 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-19 12:26 Paul Seyfert [this message]
2016-11-19 17:46 ` 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=59f455d8-de16-b735-ba37-8b3f1f0be5b2@mathphys.fsk.uni-heidelberg.de \
--to=pseyfert@mathphys.fsk.uni-heidelberg.de \
--cc=zsh-users@zsh.org \
/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).