From: Jordan Russell <jordan.likes.curry@gmail.com>
To: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: _time_zone gives me candidates other than timezones
Date: Tue, 05 Apr 2022 16:18:24 -0700 [thread overview]
Message-ID: <87bkxfw24f.fsf@smokey> (raw)
In-Reply-To: <D00CFC5E-4FE4-4874-8C13-A52EE1C7590B@kba.biglobe.ne.jp>
I like Jun's solution. I still have reservations about completing right/
and posix/ (they could be flags instead to the calling program). But the
difference isn't a really big one.
That said I did write a big email about it and I think I only sent it to
Aaron Schrab (sorry). So now I'm quoting it here and actually CC'ing the list
>I guess it comes down to whether you call _time_zone to find a zoneinfo
>/file/ or a timezone /name/.
>
>If you're just completing the name of a timezone then whether the name
>of the timezone refers to a `right` timezone or a `posix` timezone seems
>like it could be better handled by the programmer calling
>_time_zone. After all the names under right/ and posix/ are identical so
>the directory prefix only adds a bit of semantic information, which
>would probably be better handled as an argument somehwere beforehand
>rather than parsed out later.
>
>If you're calling _time_zone to complete zoneinfo files themselves then
>excluding posix/ and right/ is wrong since each directory houses
>different files and so their differences can't be easily accounted for
>otherwise. But if you're completing filenames you'd also need to recover
>the prefix which is lost when using -W as is used now.
>
>> I'm a bit more puzzled about why the separate `posix` directory exists.
>> At least for my local time zone it doesn't seem to matter if I use that
>> or leave it out; while using the `right` one definitely makes a
>> difference:
>Yeah, I get the same behavior on my system.
>
>So, no I wasn't aware of the difference between right/ and posix/ but I
>also don't think their exclusion will matter since I think _time_zone is
>more for completing names by way of files and the files themselves are
>not relevant in this context.
>
"Jun. T" <takimoto-j@kba.biglobe.ne.jp> writes:
>> 2022/03/30 9:12, Aaron Schrab <aaron@schrab.com> wrote:
>>
>> While I don't think I've ever really needed to use zoneinfo entries from those directories, I'd certainly prefer they be offered for completion.
>
> How about this?
>
> diff --git a/Completion/Unix/Type/_time_zone b/Completion/Unix/Type/_time_zone
> index cd924bbc7..c437252a8 100644
> --- a/Completion/Unix/Type/_time_zone
> +++ b/Completion/Unix/Type/_time_zone
> @@ -6,4 +6,4 @@ if (( ! $+_zoneinfo_dirs )); then
> _zoneinfo_dirs=( /usr/{share,lib,share/lib}/{zoneinfo*,locale/TZ}(/) )
> fi
>
> -_wanted time-zones expl 'time zone' _files -W _zoneinfo_dirs "$@" -
> +_wanted time-zones expl 'time zone' _files -g '[A-Z]*' -W _zoneinfo_dirs "$@" -
next prev parent reply other threads:[~2022-04-05 23:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 18:36 Jordan Russell
2022-03-29 23:22 ` Bart Schaefer
2022-03-30 0:12 ` Aaron Schrab
2022-03-31 15:25 ` Jun. T
2022-04-05 23:18 ` Jordan Russell [this message]
2022-04-06 20:11 ` Bart Schaefer
2022-04-08 7:30 ` Jun T
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=87bkxfw24f.fsf@smokey \
--to=jordan.likes.curry@gmail.com \
--cc=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).