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,HTML_MESSAGE,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 31343 invoked from network); 12 Aug 2022 19:39:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Aug 2022 19:39:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1660333159; b=OhiR2GqCcvwMUqbStHAIZwRxNTFRgQiAwPd/IyuYawKM18010jiynhu3crBhIvtjDiXJzKZ4nk M7080cykzONXxnqdp8i1fYioN8CjA1nz0l+ZS/FkK7Cl0DqDewYPpz0XHVOeK3QDoxwWF2z0gO UPkd7qw1ENhNXhxAB4vKC2UyGqzCvd3L/VL7neBnb6gpxaf6sgtBKbyfmExc0ft3Go3RntjRJf SzB6ZgulWPM2wPzKrpajhYFFQcCjYImX+MZ41lHMlYMJgAsZjpUm/XdqcjfZwuktXDiMPdEAv4 pAwFS1DgEPfz6osE//35ZOuYIXDcaExxKIqBwFJA7Tct5Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vk1-f179.google.com) smtp.remote-ip=209.85.221.179; 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=1660333159; bh=lhxUNix8CCkmZZwO2/Vh6Hhhh18Ailu+HUOdxdxz5ho=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=K6xbc6DuX6vt4UGpZ9NwfMntZWXKBaesztkIXhX1kth5vpeqYUS4VpzVbDV3YtdFysovptD9nY GR413ZaCmD2UFU9eshIPZDgcNPF0Ag9J0crmmQJxNuWjDKlQknHVIy55LVguqCxe/ItkTuZoRd ZbEzFJOhn/YhO/K4AUNgp+307YLxKMMf/PYEBrmv5jNvr7vhgzBpQtjb8+bUS9rm6FQiuKCAMR RwBVFDsqMN4ciqPsnoJL642kskWiDR6VhcOxKK1XR2bvx2SG7Lxw4Z9l5JkOlcXsZHh0XC2M9N e9RKHjy3UQrpM8uSyKXl/2oav66K/LbxGlTDwi2okJOt3A==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+YGuZr8aC31JV8bWqL204eTr4Ojj3lu/6ZwYCJk48aI=; b=qjpjscVr2vrxyBwt3OZaO0Y+Zj 5eQno+XytYBmeh6TtZ+CZUXk/mr+3CLHxiSbB/eEJ3rPKlAlRNYVStGTw4oBx5PDtyo8tswCXQtyH 22SQ7A2qCYt1rTn4QkTBCzW+rT4NBcJuINSq6Cfi9FxJLRZ7VzYxcvR7a6oTQBBsj1U7APQArc+Lv 5r5860BfM/jynDEdoQydG9IwqzXiU7rEfCrtx2A8aO+p5+EIImN4E5nbGknSveTm6v73dX9eeqnKn lBR9QnVCiGqBL45PtxIdBt5a2e8gqpbCttH4COSRZdOxuHs3daRXlgIdPBShsXvZcWqIBnEZ/p6im X34aMdrQ==; Received: from authenticated user by zero.zsh.org with local id 1oMaV5-000KjZ-3S; Fri, 12 Aug 2022 19:39:19 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vk1-f179.google.com) smtp.remote-ip=209.85.221.179; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vk1-f179.google.com ([209.85.221.179]:33581) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oMaPf-000Jva-Pr; Fri, 12 Aug 2022 19:33:44 +0000 Received: by mail-vk1-f179.google.com with SMTP id r4so968627vkf.0; Fri, 12 Aug 2022 12:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=+YGuZr8aC31JV8bWqL204eTr4Ojj3lu/6ZwYCJk48aI=; b=B8hjE1YNam1+uzbf+bYgKharGZt6krI4CX1V1SIqmRm6KktTywEOhTVAdAouFLdNWP jNaXIZQlpgAN+AteKAaGu7sQQkFnV2qn+1KgerrhweP7AEibxPJ339UaOXhYbvj4h95a IUyfotK7sxfXbQPlHoZhiLGgXdLJ9jeeCXceohr8q0bpM2iLR7Is9DqaRdhuBOGE/3ac OVYHFP933CUD48bzLVJNKDkGTfzbN4D4BfuHEbrYDC1aJ8hKKubKuXQ15/1m5QKg4Oah 5V/cIsAvliikxHCr77KAvDLwmB2WkAxh+dtVSS/iOjuAb7xhkvAJMZb5Cn3ZVxNRtmPR qDjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=+YGuZr8aC31JV8bWqL204eTr4Ojj3lu/6ZwYCJk48aI=; b=tWHE4tWxMHgup8wSdEqO2VPNbRIQqNZp2JHAhGEAj6EQKK/t6dk95ToZ6ROlzFHApz jMNvBkrfqgFl7R5bBBcHK/jt2kb35590/QI19NdCOX9C2sTsLvmjcL1ZcxGbIAzyRg+9 0l6nXjuXLWF3dEPDXUUbbG5yGc9gjXACCk94taE47PCPNNQJWSZA8TUt0id40CzoomI7 V+nkmKZ4iryDzsxKK0AehmBf+ZekNU+pyGOua0urGZcNAoLIzx4gXS5XxjRs9iPFDzej Y2n5Hc9Zg+bNk2l8qgx+hvFTdycqAgTkS1ADvndpyV/+9IGw2d6TdyEq+mI8UCs4GrN0 cGRw== X-Gm-Message-State: ACgBeo13MTRz6KXGF9Wwzd98dgFyRfVEI6XnV3vyHMnNU2CUWuMZw/E1 Eha8+krxPDCY6uVtHs0iO7cXwWMwGwWx3AquEFyCuSnfqL8= X-Google-Smtp-Source: AA6agR7OE2V/w8iuWLFl/WNiZpRnnAASnVRc7PRCRSSKWNZYUDMcDUjTmM6U2uKcKntQ+oTk28sq1QRC+nosAtMmuTg= X-Received: by 2002:a05:6122:e69:b0:37a:772b:12b3 with SMTP id bj41-20020a0561220e6900b0037a772b12b3mr2871627vkb.11.1660332822192; Fri, 12 Aug 2022 12:33:42 -0700 (PDT) MIME-Version: 1.0 References: <64b57144-d4af-4708-983b-0bd202557bbd@www.fastmail.com> <4369c556-7ccb-4866-8e69-9d829afc81c3@www.fastmail.com> In-Reply-To: <4369c556-7ccb-4866-8e69-9d829afc81c3@www.fastmail.com> From: Zach Riggle Date: Fri, 12 Aug 2022 14:33:31 -0500 Message-ID: Subject: Re: Overriding "builtin" To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: Stephane Chazelas , Daniel Shahaf , =?UTF-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= , zsh-users@zsh.org Content-Type: multipart/alternative; boundary="00000000000013658505e6105cc2" X-Seq: 27949 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --00000000000013658505e6105cc2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Wouldn't the above also break for this? function unhash() { ... } It would be nice if we could add a feature such that the "builtin" identifier cannot be overloaded. *Zach Riggle* On Fri, Aug 12, 2022 at 1:43 PM Lawrence Vel=C3=A1zquez wr= ote: > On Fri, Aug 12, 2022, at 3:57 AM, Stephane Chazelas wrote: > > On 2022-08-12 08:12, Daniel Shahaf wrote: > > [...] > >> =C2=ABunset 'functions[unfunction]'=C2=BB, provided (zsh/parameter is = available > >> and) someone hasn't created an unset() function as well. > > [...] > > > > Or the standard "unset -f builtin" > > > > Or functions=3D() > > > > (or exec zsh -f) > > > > Or > > > > builtin() { > > echo my builtin wrapper > > set -o localoptions -o posixbuiltins > > command builtin "$@" > > } > > Or ''unhash -f builtin''. > > I (perhaps overzealously) interpreted the original question as > asking for a method that is impervious to interference from *any* > function (and maybe alias?) definition. But if you've broken your > shell so hard that *none* of these suggestions works, then, as they > say in the IRC channel, you get to keep the pieces. > > -- > vq > --00000000000013658505e6105cc2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Wouldn't the above also break for this?

=C2=A0 =C2=A0 function unhash() { ... }

It wo= uld be nice if we could add a feature such that the "builtin" ide= ntifier cannot be overloaded.

Zach Riggle



On Fri, Aug 12, 2022 at 1:43 PM Lawrence Vel= =C3=A1zquez <larryv@zsh.org> wr= ote:
On Fri, Aug= 12, 2022, at 3:57 AM, Stephane Chazelas wrote:
> On 2022-08-12 08:12, Daniel Shahaf wrote:
> [...]
>> =C2=ABunset 'functions[unfunction]'=C2=BB, provided (zsh/p= arameter is available
>> and) someone hasn't created an unset() function as well.
> [...]
>
> Or the standard "unset -f builtin"
>
> Or functions=3D()
>
> (or exec zsh -f)
>
> Or
>
> builtin() {
>=C2=A0 =C2=A0 echo my builtin wrapper
>=C2=A0 =C2=A0 set -o localoptions -o posixbuiltins
>=C2=A0 =C2=A0 command builtin "$@"
> }

Or ''unhash -f builtin''.

I (perhaps overzealously) interpreted the original question as
asking for a method that is impervious to interference from *any*
function (and maybe alias?) definition.=C2=A0 But if you've broken your=
shell so hard that *none* of these suggestions works, then, as they
say in the IRC channel, you get to keep the pieces.

--
vq
--00000000000013658505e6105cc2--