From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12272 invoked from network); 5 Apr 2022 23:18:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Apr 2022 23:18:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1649200725; b=H243KX1llSPQS7KBsnrUJdnJTsKdkMTvFY2eCTyr3VKf1W2SpNa+PlJHslOMpPO3uQIRixoNod 4GqIMfgneakCNDvSZ7Nc2y0/LOEw10D25q+8yDnl7pcH1za2f3c6K7Y/fKDbrJnjfvXmMOT4rV EoALe9gsAu7SIIiv4DxZPwsebFNjbCnwZGcOYAvP8JuulHLHgBGD9PmOZNWQGIuMCJLytlindF ONag+zm7TxYeEds2xB0Yu1c+PgTGSFjwL4eXKqxG9blFX2yR2vRhmqQKuN0dzzSF1c0ULYn6Ok Dm438WCbFznd19f/10zoQ6o6rxVuRWYdbH1A5EiPHactDg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pj1-f45.google.com) smtp.remote-ip=209.85.216.45; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1649200725; bh=olfO3BwJxXdOL0WaMEaSaPq8ZUyTCwSbFROMSYlPtuM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:DKIM-Signature:DKIM-Signature; b=E1lFGFE1/PgvgvVUuuTZYN2jna+me1OzzNyfVG/hSnCZ5oQ4LJuQefpmC0uLlG+zQUezpGaaAL 2srFkWzCH9nIwBnX8A+QqlLNKTSwrkIU1+7rxlCMtDo8+SFi276E38j1WNkM0gi8Jrn+OMRNN2 56EWsOvXENjO/X2Tg/sv6nqsfj9RyFGmEe1w8MXEll1gmX4kIHzvSrfc/tOtkMg2P6Wyxadu3U eZVhoDAnPeFx2dYwcaCH6v9rA1YMoZUKwwcFbnyF4y6c31McrxlXeQ7Tfg4gHZi9tBAiEAmKPP bBB31U09fUumRLRkWARQ20YEdVaWuLA1OtI442o2EdRMdQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=om7u2oI2JVGMfxBUDzmPOpeJe5PMWZGAS4kYVDa7nDo=; b=AfzGMuSKe+JR2e+c+9VmxAp/Bm 0/4EvdVyv78xknHe0DbEF1mAq9gU3AwE7R39cMD3K5Q1EbxoZdwVh4Nm+/4LMayvdN9Mnta1e3Gjs maO04BdVS2nT//kUR/iezRzWBeyXNEihwauOvZvy1Yr+osG1JnUHDViaOfWBqgV7uuWFPta+ZYdAx p5V7fQMxaATsGv7zoVGvttmM54BFjCToGtW/IF6I1bovntDmQpjpLSGB/lB2ZhI4AA3B6lb+dCv2j EUyxHG64T2l3jkMJZNGcJyedPJ8sd8VlYe1a66mzjea7758yC/UpoivZ3ZXIoTpXhXBrF136rJDd/ fiT2jRzA==; Received: from authenticated user by zero.zsh.org with local id 1nbsRg-0004kw-IY; Tue, 05 Apr 2022 23:18:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pj1-f45.google.com) smtp.remote-ip=209.85.216.45; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pj1-f45.google.com ([209.85.216.45]:34604) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nbsRP-0004Rp-9p; Tue, 05 Apr 2022 23:18:27 +0000 Received: by mail-pj1-f45.google.com with SMTP id i10-20020a17090a2aca00b001ca56c9ab16so2801458pjg.1 for ; Tue, 05 Apr 2022 16:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=om7u2oI2JVGMfxBUDzmPOpeJe5PMWZGAS4kYVDa7nDo=; b=nRbZ10MTgULH2UAMRmyiUWCMK7kOAHjDUeC/i8XDFXenDE6Zfrujgl7gkDrbvvTzuw acKwRz75OhhH4hQcQ4Ekg+0WP2QD0X6wa4iMMDd0wKmKFn2wxKc2EvfHsdFG89wb4cus 06Tc6UPI/sPIEv96Qk0j6+76M15nBmRA+9D8OT8V/4IvgWjCpXsYR/TCAzuq4DiYbMLW PLdEM3wOnp/m5dJk4bt489LnmSqPLN56REQkLTDWrG8XNfvm5caZYfts0YCeEUplULTl 753pHSVXEZqAMS/d7j1lb2kC5iJsR6VQDv2TXcrwXx00aEk+XwTjl7lb1hHvcBlyn3qh S9AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=om7u2oI2JVGMfxBUDzmPOpeJe5PMWZGAS4kYVDa7nDo=; b=bWiOkJskY1eK/s9BE2DGo49FlUOWdLjEmLX2e/k0fFbZW4y53P6WaYZ7c50A/z/eFr YEg7TGlalsZAKeWaR4sRlrvtAFkzmVS0HHxQ0H7OmV+3QqQJmz8XBIrLPLfBSNDf1XAX IhiiJnTXWXky9nmOcUSDBINU30ausNzPgdNh1n+VjvAjP6sctEAlu+WzfUZ3CwsXp5O4 1s+2O2hBJRbpLeRx4rameSkJh7VbZ5KLYgLvEv+YP3HeTBtwtvX/7H5QCegKPeHxHLWk Y209nBrO33anLY3LrJjaGk7m28Y/LTDFffqKbC1ZykIg8/Sm2J9mX20XrqpVFoiqnfI6 NHNw== X-Gm-Message-State: AOAM531y4u8Cp7cvUYLVxtmsctKWB4M1Ve+ndREktOx6aLO6UBylQPyw C3HkiPbjG11oUJ8sIvF0eKg= X-Google-Smtp-Source: ABdhPJx4Me/wYZhVo9qOHYWF+egZFeNYZkYLdPFGwpgeSJzwfSKdgH+EymFZcm9MfeUqVsId9Mfhvg== X-Received: by 2002:a17:90a:fe12:b0:1ca:b7e8:1086 with SMTP id ck18-20020a17090afe1200b001cab7e81086mr6726112pjb.213.1649200705411; Tue, 05 Apr 2022 16:18:25 -0700 (PDT) Received: from localhost (24-113-151-6.wavecable.com. [24.113.151.6]) by smtp.gmail.com with ESMTPSA id y16-20020a63b510000000b00398d8b19bbfsm14327093pge.23.2022.04.05.16.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:18:24 -0700 (PDT) From: Jordan Russell To: "Jun. T" Cc: zsh-workers@zsh.org Subject: Re: _time_zone gives me candidates other than timezones In-Reply-To: References: <875yo3b3ka.fsf@smokey> Date: Tue, 05 Apr 2022 16:18:24 -0700 Message-ID: <87bkxfw24f.fsf@smokey> MIME-Version: 1.0 Content-Type: text/plain X-Seq: 49997 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: 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" writes: >> 2022/03/30 9:12, Aaron Schrab 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 "$@" -