From: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: completion for "info -f" does not work
Date: Thu, 17 Mar 2022 00:28:56 +0900 [thread overview]
Message-ID: <1A53A198-35F4-44D3-9B85-86A79A0233C9@kba.biglobe.ne.jp> (raw)
In-Reply-To: <1515237577.54444.1647443187880@mail2.virginmedia.com>
> 2022/03/17 0:06, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
>
>> On 16 March 2022 at 08:46 Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
>>> 2022/03/16 3:05, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
>>>
>>> + if [[ $PREFIX = (./|../|/)* ]]; then
>>> + files=( $^infopath/*.info(|.gz|.bz2)(-.:t:s/.gz//:s/.bz2//:r) )
>>> + tags=(files)
>>> + items=()
>>> + else
>> (snip)
>>> + _requested files expl 'file' && _files -g '*.info(|.gz|.bz2)'
>>
>> 'info -f' accept any (relative or absolute) pathnames. For example,
>> info -f foo/bar.info
>> works; we need not type ./foo/bar.info.
>> So the pattern (./|../|/)* is to restrictive, I think.
>> # And if tags is set only to (files), we need not set the array files.
>>
>> For the -f option, isn't it simpler just to use the action
>> _files -g "*.info(|.gz|.bz2)"
>> instead of
>> ->infofiles ?
>
> For "info", at least, it will complete files in the info area as well
> as local files, so at the least we're looking at combining the two
> types.
I feel just '_files -g "*.info(|.gz|.bz2)"' is enough for 'info -f'.
But if we want to combine it with files in infopath, we need to set
tags=(files info-files), am I right?
next prev parent reply other threads:[~2022-03-16 15:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 17:13 Vincent Lefevre
2022-03-15 18:05 ` Peter Stephenson
2022-03-16 8:46 ` Jun T
2022-03-16 15:06 ` Peter Stephenson
2022-03-16 15:13 ` Bart Schaefer
2022-03-16 15:28 ` Jun. T [this message]
2022-03-17 16:29 ` Peter Stephenson
2022-03-18 13:59 ` Vincent Lefevre
2022-03-18 14:09 ` Vincent Lefevre
2022-03-22 9:46 ` Jun T
2022-03-22 13:32 ` Vincent Lefevre
2022-03-22 9:35 ` Peter Stephenson
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=1A53A198-35F4-44D3-9B85-86A79A0233C9@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@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).