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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7858 invoked from network); 24 Sep 2022 11:08:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Sep 2022 11:08:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1664017682; b=HfZqaKF4tWl5MPb9FxhkKraIct51QIH3C1CJsO0gnpPRQAofpCEoMzarouCSvKWv2QrTzTEqhR ClPiJ9rQN2qAMKGPjMBijT5K/B78NLbQ316CXyWZH2XubQkqyLY+Go0ahc9+YaKx9noFNiGPRe DkyAxOYHfgf8NJlHVBYTsO27J3rVd5rROZ8ea2q2fQnGcKgDknSRXmWfHdwQc8VAnm0WaxPoAF eouFxDvb4OgfiNMfnlfI0D3ZVgzxvWoh0H1uT4ev6eRFy26Ecz2l86ma1D2X4G3cs5SLa2drHN z36qo025gOZNF4tRzcdP5ftG8NkeLaf6OO9LBRqbyOwIlg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f42.google.com) smtp.remote-ip=209.85.217.42; 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=1664017682; bh=pnxEfUD7FtM3dz9GyNinvGobGikyhGChWqce0Axe4OM=; 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=H36gG8SxXcMY4BdDNldj0YaA2Ew6REEAvd8BeGGjpZfRPotnc7r8BzGiDWerxBaJlZ/I2bxIsA z98uZuI/eZgMygzTj6APzmHJ97WUFU1U3AkK+iW72f2ECvmEd5U5t8zkyDPn4eiRr4tDjC6SHO TIKgP51TH9yt2sHtvVqFWCsqtuURiZeHlVysO4M3U+uUyUvwYrlooRup+SP9kXiAc01EEZ4EnJ MGg/6Lq7j/Oiet+bYke5prcY2IE53Htx/1jEzO3DMY9lhAmDnEdw/TI5JUA4RXu9WZTZ1sDugf myUMgsClRU8EpAQO7GzYWDT8R40ASyJxI6BVaYhmlKMuhg==; 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=Ng4NC91WkHZZXDqrcQHV1Mprh6x/uavWl/m96A5kfp4=; b=BZCAIp3IOOwX52GO8m33uZsD9c P7v+Cki9jjz6doNjpGPbuPwhIirMGwgpXlw6knlBMqcvhyWZHrUqmQiYPR+I4SZ6EPwpmtQwgv1Fh 0wwDsUy4MNziZqZ1sE8rtBZkvJ6dnkrwP154RRGhDb8n/BsFWKHRxpKmb2L9Vm2eMDYQce8TSovRK RljPJeBX7E56WLxc6tiIne4mN44CyUvRTBJvcniJknZqSROFqHkDEfkEOI7QTw0b+8YsZsSkwcKHe LIpktzz2DMgZ5Nz/5CZBD3cFsJ72yKmfJR75IHoIex1Pt94AdMNjC+oghJheNvrnS5Kg5KxL6uaPm xYdaGHWg==; Received: from authenticated user by zero.zsh.org with local id 1oc30r-000PbE-Ag; Sat, 24 Sep 2022 11:08:01 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f42.google.com) smtp.remote-ip=209.85.217.42; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vs1-f42.google.com ([209.85.217.42]:45637) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oc2vZ-000P6b-Qa; Sat, 24 Sep 2022 11:02:34 +0000 Received: by mail-vs1-f42.google.com with SMTP id m66so2230129vsm.12 for ; Sat, 24 Sep 2022 04:02:33 -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:subject:date; bh=Ng4NC91WkHZZXDqrcQHV1Mprh6x/uavWl/m96A5kfp4=; b=iokn0v4V7t1fk53xTPh3qYKY5Oyx8U9gDLvKvry4490n331Jf42j1r+g16CGHafYm4 X9y71Q52DH5/jf9gXNrDgLjClB5KVEeKf38sptKHOA1WvH+sBo6DFOfaXiXsQtyE0YoG mP6sPYYQDKVKg7fwv/ZLxd4t+8P3R3snTi9kPI4H90YtkbzLHp3W05n58xyaZqBZYWMM uOaN9k9ja44L2CLL2v8n/hxHXJY6yRfOXyyJGIpTqcIveZT/L96yqXqVKghsTpriLwtg E3Fk57i9fpLnhc4IBWOPIIbiZJH/WoG2s52RaHhWgEyErM9NHtLUIWF2/RNK5Z+bv966 7JgQ== 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:subject:date; bh=Ng4NC91WkHZZXDqrcQHV1Mprh6x/uavWl/m96A5kfp4=; b=Yl8MwIytbxjraO6FjiCQPDD6nEXS2rauUAWWl/LG/igK965MyGxVT0ze98PGIAUWF0 VT94CryrP49mPzeh0s1dvXAWFchLeR1c3vf2zU5ApEPn/x8jo1MzW2qOAev98fxHjrmE zt11+isS3+wGcc33wECBcmOSF2FEJK5560bDgxIzIcvgY/B0gKvwB7A2wU/9IRoWn6IR R1oWW/6fyiuh8PT3eX4O7FE741/RDR3Qit+Xzr4w5TfOBy4Dre/TSqb/wQNkDkr0Omvr mCH+Lv7hZ4WndZ+CYCalFrTzKpkRIK+Wc5w0kB7nXZROUN2jsqEx4U1u4E8FyyvnseNn jzWQ== X-Gm-Message-State: ACrzQf1Wx0dJxk7to+Yu0hoDxEkT62bn7QiTTiQVFcMjdmvzcFgouqpx c0W7qWIkoZrQWCkFmObJjdBSPPOtvaCFpgd3eBg= X-Google-Smtp-Source: AMsMyM47PeDkndjDItX8+JLiE968fnkIRwSqHrHNy90+DnJqfbSxKi8JpMQbVnx1KmSNXgRIAe5dcw4EsQ4eoUcNYRI= X-Received: by 2002:a05:6102:ed3:b0:398:6aee:d7fe with SMTP id m19-20020a0561020ed300b003986aeed7femr5129415vst.54.1664017352467; Sat, 24 Sep 2022 04:02:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sat, 24 Sep 2022 13:02:06 +0200 Message-ID: Subject: Re: Complete global aliases? To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="00000000000031ac5605e96a3b95" X-Seq: 50664 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: --00000000000031ac5605e96a3b95 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 19 Sept 2022 at 03:46, Bart Schaefer wrote: > On Sun, Sep 18, 2022 at 2:43 AM Sebastian Gniazdowski > wrote: > > > > On Sun, 18 Sept 2022 at 01:27, Bart Schaefer > wrote: > >> > >> Where would this fit in the overall design of contexts? > > > > I'm not sure, however there's a solution on the web, see: > https://stackoverflow.com/a/59513051/11999858 > > That solution gives the user control over when global aliases are > completed, by adding a function that can be placed anywhere in the > completer zstyle. The suggested value of that zstyle happens to make > global aliases complete before anything else, but that doesn't answer > the question of how a default should work. > Maybe looking from named dirs perspective can help? Currently, cd ~HO doesn't complete, too. I think that lack of such an obvious feature can make forward a way of completing also global aliases (like alias -g HOME ~)? How should be ~HOME completed I think that everybody knows (with exception of me)? The global aliases should be completed the same. > >> Do the aliases expand or is just their name completed? > > > > I think that only its name should be completed. > > I'll note that theoretically the ^Xa key binding (expand aliases) can > be programmed to complete when a partial word matches an alias and > expand when a full word matches. I didn't attempt setting up the > necessary zstyle contexts. > > When I tried ^Xa on my incomplete global alias it didn't complete=E2=80= =A6 > > I think that it shouldn't be expanded, so the issue isn't actual. > > Upon further thought, I agree that it's not an issue for completion of > an alias itself. More generally, though, if the expansion of a global > alias contains ";" or "|" or "&&" or "||" etc., then ideally further > completions shouldn't be using the context of the preceding command > word. Unfortunately that requires checking every word to the left of > the cursor for a global alias, and expanding it, to get the "real" > context. > Could it just complete like ~HO should ? I don't really see the context issue, HO and ~HO should just complete=E2=80=A6 --=20 Best regards, Sebastian Gniazdowski --00000000000031ac5605e96a3b95 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, 19 Sept 2022 at 03:46, Bart Schaefer <schaefer@brasslantern.com> wrote:
On Sun, Sep 18, 2022 at 2:43 AM Sebastian Gniazdowski<= br> <sgniazdowsk= i@gmail.com> wrote:
>
> On Sun, 18 Sept 2022 at 01:27, Bart Schaefer <schaefer@brasslantern.com>= wrote:
>>
>> Where would this fit in the overall design of contexts?
>
> I'm not sure, however there's a solution on the web, see: https://stackoverflow.com/a/59513051/11999858

That solution gives the user control over when global aliases are
completed, by adding a function that can be placed anywhere in the
completer zstyle.=C2=A0 The suggested value of that zstyle happens to make<= br> global aliases complete before anything else, but that doesn't answer the question of how a default should work.
= Maybe looking from named dirs perspective can help? Currently, cd ~HO<ta= b> doesn't complete, too. I think that lack of such an obvious featu= re can make forward a way of completing also global aliases (like alias -g = HOME ~)? How should be ~HOME completed I think that everybody knows (with e= xception of me)? The global aliases should be completed the same.
=C2=A0
>> Do the aliases expand or is just their name completed?
>
> I think that only its name should be completed.

I'll note that theoretically the ^Xa key binding (expand aliases) can be programmed to complete when a partial word matches an alias and
expand when a full word matches.=C2=A0 I didn't attempt setting up the<= br> necessary zstyle contexts.

When I tried ^Xa on my incomplete global a= lias it didn't complete=E2=80=A6 =C2=A0
=C2=A0
> I think=C2=A0 that it = shouldn't be expanded, so the issue isn't actual.

Upon further thought, I agree that it's not an issue for completion of<= br> an alias itself.=C2=A0 More generally, though, if the expansion of a global=
alias contains ";" or "|" or "&&" or = "||" etc., then ideally further
completions shouldn't be using the context of the preceding command
word.=C2=A0 Unfortunately that requires checking every word to the left of<= br> the cursor for a global alias, and expanding it, to get the "real"= ;
context.

Could it just complete = like ~HO<tab> should ? I don't really see the context issue, HO a= nd ~HO should just complete=E2=80=A6

--
Best regards,
Se= bastian Gniazdowski

--00000000000031ac5605e96a3b95--