From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13272 invoked by alias); 6 Jan 2018 06:11:58 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42238 Received: (qmail 7091 invoked by uid 1010); 6 Jan 2018 06:11:57 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.214.45):SA:0(-0.4/5.0):. Processed in 13.706631 secs); 06 Jan 2018 06:11:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_WEB, SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CcVQlD5LYISkfnlya5UAcZDJ3JaeQ1dVtRVO6JfC+XY=; b=cxHZX09rgdf28DpYOr83cWJT1ZRY9eTsTxqnYtrgt/cRSzwB4NrVbrORKPEVVngD0M JPOQIQ7FGBUj0BmdaWUTYBVkDqXBepJZzcnx5zkUcrOaHh+sg7tCd3tsT+IQV4YVIvXF VcgAjWI+ezUZ16GBUaAId4b8xPUTv/qAWTMYmK0L5LRtbx3hQBGeIHOBkoOJTBMykXqj 0SvePiCbTaS4+EK0GcfoGVaWArQefE6RKQgJG6cQa0s4aKd3gwCK4qE/5Mgvqd5yb7NV NcMOF3DKGMCnJVUcJtqrWbl0+HL7fXAvlPLYXBN3iycEQJIr9tCoAY0LnFUgiyPNee5V Y31g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CcVQlD5LYISkfnlya5UAcZDJ3JaeQ1dVtRVO6JfC+XY=; b=GwcV1lrbKmB1N0+QNNXVMpPdONd98FLQZqMimk5d2FXcnaghHL6E4H5o++oiCfOOaZ zqQWssrZ4R837+CkaJ8IOwXOSOVsvjA2pPKe6AmbarjdRguQeUcdrfRju45xHDjDLOXW 4SZq0qEHz4dxMLxJkMxq2mfIgQJtdV2HrD8R8NAWNnGo6TEpnqJUD9lxgCtZT9MPQjcv jRQl1IRhxUq+qSUTPAog2DvqK7gpXJZwqiKTStfLq78byKcEz+fILo4JxojHy3dwiQcu zt60J0mHGFY5K+c6OdqgnnBVSUySJyC9Ov8fI4BIlLb4nq8syqgfV9L0SyHNsbNS6Yjj 0QbA== X-Gm-Message-State: AKGB3mI9/DJA3rwtm1G+VhRe2Psmi7oOPvlY90gNQVN+LRKfJcn5vTmT 5jZVIS3SpFYy7I2NCySQbqqSZw== X-Google-Smtp-Source: ACJfBovTMdyMfpdkv5KuxDatnGn4nqlbT5msKnk+z526OJIeVgEymuo5vJ4LUawHAGK9cOnkIAMhTA== X-Received: by 10.36.224.74 with SMTP id c71mr825592ith.140.1515219099759; Fri, 05 Jan 2018 22:11:39 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] Completion batch #2: Misc. trivial fixes From: dana In-Reply-To: <0D626F37-219D-49BC-A1CA-31A8F1CABF1E@dana.is> Date: Sat, 6 Jan 2018 00:11:38 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <909F11B4-7936-47FD-9A2B-F339BD73125F@dana.is> References: <289FC0FD-FDAB-4575-8882-E9F8F3FFE4C5@dana.is> <18174.1515022825@thecus.kiddle.eu> <1C17F1B9-C935-44B0-A8E4-52D87EE76DE6@dana.is> <20806.1515066433@thecus.kiddle.eu> <0D626F37-219D-49BC-A1CA-31A8F1CABF1E@dana.is> To: Oliver Kiddle X-Mailer: Apple Mail (2.3273) On 3 Jan 2018, at 18:03, dana wrote: >The way i had handled this in the _busybox function is: > > _cmd_variant[${words[1]}]=3Dbusybox _normal > >That way you can temporarily override what _pick_variant thinks the = actual >variant is. This seems to work quite well, but i did feel some guilt = about it, >since as you mention it's circumventing the interface. I was playing with this some more to see if i could come up with a = better way and actually discovered a problem with the method i described: it is = *not* a temporary override. Apparently pre-command re-assignment of array = members doesn't work the same way it does with scalars =E2=80=94 zsh doesn't put = the value back the way it was when it's done executing the command. I assume the same = code is involved here as with the issue i brought up in workers/42097: http://www.zsh.org/mla/workers/2017/msg01761.html Anyway, i suppose i could re-assign or unset it afterwards (according to whatever the previous state was), but... it sure is starting to feel = fragile. Exporting something to the environment is the natural thing that comes = to mind when i need to communicate with a function that i'm two or three calls = removed from. I guess it could learn about a new scalar? _cmd_variant_override = or something? I don't know. There are lots of ways i could change this to = work for my use case, i just don't want to leave a mess. :/ dana