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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8580 invoked from network); 19 Sep 2022 01:52:00 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Sep 2022 01:52:00 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1663552320; b=PBn1wtBiLzYxVNLcnEWUX8C8t5+4F58Bu9GDsfDkWi6serHczctuPM6kgshsAoakVNM/dMK7Dl ccWKGat2t+fWPo7GDqYmEoJPUxDvWPdBbVD5IVFWykF9fIex33ssBxgHFJqDRNcpyC1wK2VusL jsQJJaXJU8nLyby8Q0nSMOGY4nZ4UnAb45YUp2IvVMm43Sx4ItKl+VujFJjKyFPIA8C+UE0cXh Vud47Xtpt0gGI5OUHt3jRbYbCB3Qtn6IJm7hyCbE+5SkELbKuJePjxUfwMb3ILabH5NYn2Ye0k Xf71ktvUZNycLg2gr9E9FMj79jXoEosJIST04ph/bOJaXg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1663552320; bh=2P9AEdV8+/wtdLALAzaDvvK7Wr+g40bRkTv48SxOusQ=; 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=HYPbFivaf+lwiVuNJQV2w8dGwiEw3b222b2/0/kiLTB3LhwPq0CDujbGpyhwxixkyvNARsIF5M gWtjEwXiwb4taFoTUAbgcGy1JJgYJJxrgdQmetMgDnVl4tICeA75vMz1S/34x+IlgI4mbuiOaF S+taHA/y0J1h3m0if49AKT3Wv4SKCLroAM6C/c/FeJOZn64VxRojO8BFc+5WM6T8AXSZMSS+bz vtBhTBcBBrVpGNyl+mv84lM5TYYonNvnV91GbARVya8wBR/7unBs5j9RV9DSxtiCsl9HUVzqIY z6Vwlvfbmh3+NUKUaIovYoS62rOFsqDUDel1nWlyYddZ1Q==; 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=PUi5M3JXFq/deCNlw0qGi3AKKbSGz7YbslSrH7213rY=; b=lNxjCdEX5i9KbHct50UUdeKauR WbgFaERrFoH9xn1uBMbrk69EuiTqqwkjjUaVRjJaCgzqlgZZMbsR61M/7eF4tkIQKFcIKPNq8CFDp /4QfLTToIWn3c7hLcyJTzCThFG8RO/+dEvucVEtzCjApjUPUanO3dJGPSJXsszE7ptTilkiGF3BaA 8D/3W13p0y1bxi1icFSSnX2GNXzBEP2bO/mXt3LA0JjvOjGbARPaWOj1jhPP/sANxxjcB5x3/w/5q A2BWshiaZSRaEOtLikT539ld+L3nC91cJnlrJtw2uypQ2MxwoMHUXBAF1OCsgRZsp6crzwRCSA6o1 kGtnDrpA==; Received: from authenticated user by zero.zsh.org with local id 1oa5x1-000CrV-1b; Mon, 19 Sep 2022 01:51:59 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f49.google.com ([209.85.208.49]:35748) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oa5rn-000COl-Fk; Mon, 19 Sep 2022 01:46:36 +0000 Received: by mail-ed1-f49.google.com with SMTP id 29so39235125edv.2 for ; Sun, 18 Sep 2022 18:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=PUi5M3JXFq/deCNlw0qGi3AKKbSGz7YbslSrH7213rY=; b=Fo1DJVaHSTMnZYy3RktNKITPVN2ojDbAW8+1afBvay2ZffGY/tTBBqX43p0a4qMWVU 6vt+kx/Tg08JM25sTiiZGHZFOXlAKTvAqXJ0Q+bTC1zKFl2KpoSpuwJKHnh07gFd4Avo t9FESc90TtsbEBIcYmLKHoP6qm7PAarpOniEHGYiLOPd/ByAkGgDXbENLPz/HUv5IHBY Q72NwuZbZ/yqeYzOUSGKsCzHtkFba2BQV/OabgYS5EAEtzo3RkCxCTIafYNULlkHBhGs MiCXcXN/364KN4HETc6rG5TSiFsX2LeKoa49HcYDkLxBokB9uRUARc4AR3bkO3gXnMlE QAmg== 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=PUi5M3JXFq/deCNlw0qGi3AKKbSGz7YbslSrH7213rY=; b=jJp51NIFbNWgxz4zrfsK1afv83y8ijYECCLDMY9AEgaFL73t9fW/ckzzVj+ftN4kep hC9S4rEYEROFiCawcwaoCeeq3yZgFw8VsCbPy8wUe537rBlyvQq/7E90WkZKtxpiHmGN fY4kBa15hiY3ehKZEMz5ghYGtTW6zB3+W8pU4FzW3dnZY1spi2DUYRuKCLK6v+q9OjU9 GoT+07004xBRtEZL+QMt4R4T5fXOPwUleDmMt7zRaU0AZXoV7GutCDr1gBUZNSoe3biQ PkVkSKOXQBLyFdZuiKjTZqv9Ofp9W83rpCi6iu3F0jCn5aJOiZpFpFDNW/FT7RiAJbHz XyTw== X-Gm-Message-State: ACrzQf3Ph9FNQYz1xlVdNIiJMk+DY70/Df2B1BP95DUwMbOB58XPQx72 epR4D4bZkbfBGtCMHyzoDxmVpu7gmchvbAHJqCkVXQ== X-Google-Smtp-Source: AMsMyM6V8anvE9ykBRBiGfSiarF6GQHQnC1CDtkWIX2qAVEMIODLOkV0gEVgiZT2T84GrTj+DZvVnQ5R0nIODcWFOnU= X-Received: by 2002:a05:6402:50d4:b0:451:bf26:8c41 with SMTP id h20-20020a05640250d400b00451bf268c41mr13545499edb.219.1663551994651; Sun, 18 Sep 2022 18:46:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 18 Sep 2022 18:46:23 -0700 Message-ID: Subject: Re: Complete global aliases? To: Sebastian Gniazdowski Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50647 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: 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. >> 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. >> What happens >> if you complete to the right of a global alias that (if expanded) >> changes the syntax of the command line > > 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.