From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 68005742 for ; Sun, 25 Aug 2019 01:15:02 +0000 (UTC) Received: (qmail 22044 invoked by alias); 25 Aug 2019 01:14:53 -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: 44707 Received: (qmail 21855 invoked by uid 1010); 25 Aug 2019 01:14:53 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f43.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25545. spamassassin: 3.4.2. Clear:RC:0(209.85.166.43):SA:0(-1.9/5.0):. Processed in 2.131824 secs); 25 Aug 2019 01:14:53 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.43 as permitted sender) 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=5uydaYhVY60aeM7jccjN29GLf37NXBgDnJ1z0RdAAgs=; b=1XiCVgztZgJa4LdmwDXSr/mXZeRPwj8S/dUIfX03ixCbyj3OMdER7T0Ds7z2a/ufL4 YqQglKVXFbMwoI7AIIZC5wJHctuT01zhpxkYclStoVMEKG/De0er9/3rr/Dd3hSqW+wa v8GORPZXoR8VNKikk1RIItuM1NBmaARvwSE3fBVJ9gNTvVtiP9lW65p9WVr91+uFNdvh 1CQqpM79fuBQ5iJh+XYhjDRTeZgG6Sp3+8n0hy6dBGLaFDBwk/F/cleillRhx4hYsOd7 LI7TgWbQDqSKFTdNdRNZUsiyYBFEr+UVIGC3fGw93n6IKBgbpPQqZcaf/9SQhliJSlNO BTBQ== 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=5uydaYhVY60aeM7jccjN29GLf37NXBgDnJ1z0RdAAgs=; b=M7qQaW5PcyxDRu+DQgSkD8HVNUQAxZDc9jVPBOWvu1xg5Qsc+t4AAi82QbFCWonVSp W57+S9pji+xGYvgRaKAI4eB8X2KV5MmDyacufeT5HIkjiUcxsNbVdSmORjKDs3LXF4Dj bPACyHWE3CTsuJlAjMtxlH9uZWWeyUg6e+jnqPqI2jtbIvxhqQB/5n6xudJ2wWCRWQpg ni5iCzpDY/KQPXuJhVnX8dZzKdQhmgbVZma7LBljX5Dxqv+d0TrR0G46/7upfjRxi/P1 35t7YuUeGIGQf6O0Jq8yMl2ooIRJbIcY0eTc3+f1a2Or8AKyjYENSRabIWsG5Oyzj05N OIQg== X-Gm-Message-State: APjAAAUIRxB9Bw9EfV7X8GR0KAGyH41MDtvhBbRfasw0H2EKKfhY+9f2 Tyrp/FD/FT954kvCL43eFaPLkCuFUt3GHQ== X-Google-Smtp-Source: APXvYqxE1m8qOK0Jj9FZk6ASZyKru4Dz6Uvk8NiWorG8YN2VrMWIopav4emJgb2+slGcR1+taJuDog== X-Received: by 2002:a6b:f008:: with SMTP id w8mr2489524ioc.60.1566695658690; Sat, 24 Aug 2019 18:14:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: help for writing GNU stow completion From: dana In-Reply-To: <558a3ff8-d6f1-9ab0-3387-a17ca5e0e75b@yahoo.fr> Date: Sat, 24 Aug 2019 20:14:17 -0500 Cc: Daniel Shahaf , Zsh hackers list Content-Transfer-Encoding: quoted-printable Message-Id: <707548C8-840F-449C-BCE4-3E406F6FACD2@dana.is> References: <1e5195bb-3126-8d0c-8a6a-1f5a5fd2a6c0@yahoo.fr> <0618d7fc-5334-4e51-829a-8684a81744c1@www.fastmail.com> <558a3ff8-d6f1-9ab0-3387-a17ca5e0e75b@yahoo.fr> To: =?utf-8?B?QXVyw6lsaWVu?= X-Mailer: Apple Mail (2.3445.104.11) (idk what's up with the ???? here, it says UTF-8 but it's all messed up) On 20 Aug 2019, at 12:45, Aur=C3=A9lien wrote: > But now if I do ?? stow --dir=3D$HOME/.dotfiles ??, I get ????no = packages > found in $HOME/.dotfiles????. Maybe I missed something??? It's because of what i said before =E2=80=94 the argument you're passing = to that helper function is the raw, unevaluated text from the command line, so = it isn't expanding $HOME. The only easy way i can think of to *make* a = completion function expand that is to evaluate it, which you can do with eval or, = as i forgot to mention before, the (e) expansion flag. But if you do that, = there is a chance (though probably not a huge one) that you might trigger = unexpected and potentially even destructive side-effects when the user invokes completion, which is why Daniel objected to it. If there were some kind of 'safe eval' that just performed 'read-only' parameter expansions, you could use that, but as far as i know there = isn't currently anything like that that's built into the shell, and it's not = ideal to special-case this one function. So, without a general solution, the more limited version in your last = message might be the best option for now dana