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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7518 invoked from network); 3 Jun 2021 21:43:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Jun 2021 21:43:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622756626; b=Crme0XwiKojJ9Oi21m3wOAfTlz3+7jqy1fwm1XklUiWp/gFQisVz/LsaL2+IihU1it1iwTOOG1 yw2LvTZgk7DS2L97AIbyr0uO6n2S1pRrCoZa5vDKMgcPgbNi0SfH4jFQPxjQhUlYiz/ch5rVrw MkQolkE93PuPV9nkniEG8S01eODEPakedA1G2VSjf73W/LWoxyANw/qPGQvDo0pEBkegcyQ957 IKK4oJ3qZTavtsKzw6oGlkCGWi9T/K9ycYdKlT9GVVQ5pWPhdoOQ5wt6w++y5wHvMXsBIsLCph zkO46FZ8SLn3yi2b6yvsaIHK91xbaUziKs16X6Tp4D/uRg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f47.google.com) smtp.remote-ip=209.85.167.47; dkim=pass header.d=gmail.com header.s=20161025 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-20200801; t=1622756626; bh=73JvNv8WlXrT7kizKbKG/jMKKcF1xxxY+WPzTDdIHtI=; 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=jMZr+j9AyJzXTvQRUexEdShQvPc/TRLNbAFJi7uNrogfc47XA3fJa/IGbjcyKxdL452cfUbNCq fqiolpzGQEF1nqa2MVCdg4wjbGiopmCMTogxwrCixCj5ToT/vemqvLpcVmXP3Dxo7eGKGcOs7b NoMBL6hLP/MbhmCXqktRbJL8I3LH1ciUFaUs83UoK4UPfENnyAtd54DdsZK25jrLav/eViuoqX sMTSYj1DFy5AIe9kKb3TAGwJCN1fb3p+afieMEfsL5ZADdxgxt43p6l5M5hn3ubp9lavUbw0iq AyyjNIoAKHMj/Oi40+YaBWeDPocbApu7Awf4bnsuPnluKA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=dGghzbK87tx2hPlh/hyunHipeo6zrUhdQZhCHXj0Qio=; b=VQyw83OKg3WppIRHRIx6+Aexye 1Aiof6E6u+W/Ik+Hedpf9d5b2H0sJkapYa2yQgZhf02K1Cg3kIzwiCorwKkj/aZzOcZx22zkSk36P J2xpiCREA7IawI5X17hfGNR0csYCiH3ThPUhh3cm5cO0XGtrwDPNfEoBo8HkZRKEnJOM2wDY3QzVu DNRbLPVojUwxAjq3BLgixeHQ3d8Hl7dOuiNmHiqUavNlZx95PXZlcnyVtTzz1/s9zkdQB14nUVZiH Mx9eRbhc2sINauUTNCkZCsetrrjkBdLOrvZREokF6LYuiexnSCvgYwnfoDmBwv3ltnM7egAAP7wYZ XvcVfZlA==; Received: from authenticated user by zero.zsh.org with local id 1lov7y-0005Yr-A7; Thu, 03 Jun 2021 21:43:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f47.google.com) smtp.remote-ip=209.85.167.47; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f47.google.com ([209.85.167.47]:44968) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lov7k-0005Hs-JM; Thu, 03 Jun 2021 21:43:33 +0000 Received: by mail-lf1-f47.google.com with SMTP id r198so7652926lff.11; Thu, 03 Jun 2021 14:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dGghzbK87tx2hPlh/hyunHipeo6zrUhdQZhCHXj0Qio=; b=sq9QeSsUccZz9sbrIRU2kVOhj6VS89+c0L272T+DhG+HT4CIxmNsszZQY4ueT4dJJ4 yvz/FLwMIZFAvRsZ1WqiB+Otmyeje60hGY9d16LPjtzfDD8suyipjuTaI411bi5n7eCQ 26OMLEDVgShHabbDAQroTkZZatXlxDhA6K3KFRIjuBDlZ08ftLCOkeb76cMQMPeen2TK 51wl8cnEXzu2wfbG4nLclwGkWiOtZX4VyxJtIt5PGc2vuMm9v2ArNw9ZnLd3VHL1X+Eo 7dSEIB2yyS5jbzKgCepR/cmv+Fw7PujDkuoGmZZTtXUzftHRuEBc1pTReW8AXdlmxYwc 4y4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dGghzbK87tx2hPlh/hyunHipeo6zrUhdQZhCHXj0Qio=; b=U/II92R/HI964QKk14vuO96SUcGHMIXyC2PTM/rC1Z0R+WIZQ4C4YiH+xnWyX3zv9Q cA8sXqbYwtFY5umUZ9YMiNxT1Q2vEmoNB2Xa8NGHa7LpeN5dsnKRGJ5DYBTVPc/nLwQ+ SBUOKgy0lN1B7B7MkNKTXBQlqMZMoCcoiGKE0LpI3lgYtPIo9a7shxa5VRUhGBjNBxPu QeMdMuwNawnuRg0PB1vXBLOa3ladXrIVUInOUdi506mGW/JbwzSmPRoF4Mb077Fmb8iL LJK95xZwJrttcG8QU2EZlAF0VMRNVPuG1jmU+8UvTG/nMHgsETRV5zqi+hv4qE+fvCmj vM7Q== X-Gm-Message-State: AOAM5321MZzPbePHd4ofkZcHjFHv1NIosGEG+ZZUyq0tby3IsLiPBcTw +pATyHy6kaIhx/6hxfK1ppE9LYvufQaiAtx/DsFc8w1nViQ= X-Google-Smtp-Source: ABdhPJyR0n+Xo0Jo7VW7n5ZBOn3Ew3f85T5achIXdwjfgv9m/3TmXGkW9IuKM7o+OlZ3SGDP2mV4PZ5GAuuZyU8/dpQ= X-Received: by 2002:a05:6512:1150:: with SMTP id m16mr624015lfg.486.1622756611465; Thu, 03 Jun 2021 14:43:31 -0700 (PDT) MIME-Version: 1.0 References: <36227-1622676235.815398@zrY_.ZerV.zhJL> In-Reply-To: <36227-1622676235.815398@zrY_.ZerV.zhJL> From: Marlon Richert Date: Fri, 4 Jun 2021 00:42:55 +0300 Message-ID: Subject: Re: [PATCH] Make _expand_alias more usable as a completer To: Oliver Kiddle Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49007 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 Thu, Jun 3, 2021 at 2:24 AM Oliver Kiddle wrote: > In practical tests, I'm not finding that this works too well, it ends up > removing the characters typed. I cannot reproduce that. Here's what I tried: % cd $(mktemp -d) % print "PS1='%# ' PS2='' RPS2='< %^'\nsetopt transientrprompt" > .zshrc % exec env -i HOME=$PWD TERM=$TERM zsh -d % autoload -Uz compinit % compinit % _foo() { compadd -QU 'ls -al' compadd -Q lsusb lsvfs } % compdef _foo foo % foo % foo ls ls -al lsusb lsvfs It inserts the unambiguous prefix and cycles through the three choices, without removing any characters I've typed. Am I missing something? > I also wonder if this would be better done from within _command_names > directly but I'm not sure. Actually, I feel like it could instead be added to the _expand completer. Would that be a better idea than what I presented in this patch? I could, for example, move the actual business logic for expanding aliases from _expand_alias to _expand, and then have _expand_alias call _expand to do the work.