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, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23045 invoked from network); 7 May 2022 20:39:29 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 May 2022 20:39:29 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651955969; b=k79QMlbR06pT/l5Tl1gyOyZ3FIDBTO1+x3LXFyALyqWkWQ4s91ECkZgp2fGl10gODybnIa9suu SfRwCzVqTkUmhZxWK/WpinIK55fCuPcQVUwCFsPpVe6YxXPJNJnRCw6DmFapzfViFznSGUyH3f TfSWwDs9bps/N8XZKE0YuwRKFsaI90ezvol7S9nzA7abq53FD5hVPoUHoyvnO6SEuVujwJZlwl /Apw7QciUt7pL/qrYrnL++O/2lXUdHQeZV/150HivIqSTcCboyhCNQbJW+DmsAhFRxr5wbA398 TdtAdKy2Aav4UB4R1arYbYPfBbQsB1S0m1BEUYG2gqr3XQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; 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=1651955969; bh=2hlphH74/6dhiA7VkqTDJJUG/X1pq7Uooa64tV++zeo=; 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=MEprpx2V/DN1XSCpWOr6Ow85ymr9ESfz1yVMB+6bLsx3jnvjZbz6SG8T2KlP6oJguk5L9zRVPQ xT9ViqNpTGXZysYfYab4cTCFV/nd8NbLE8Xzc/0u0i11BAYDFbVqQdGVc6WxSiZiJZ8rFWFGYY EwGq5TnWLnIuSdao34vF4hSoTptDsdPFpr7/7QPMvj+AfKyyD/O+Ko5yiL1dHeuKmAf/g1wBeC EgbtVN4hrzVVvX4o9ZmmtPOqBc5Adklm/HmJ5OK06YK5d+y25e8ZoEDJ5smbMsEDF+I9wqNQxO SmIN73Kly4HZY3gmfqxxQ2cvVjcj9I/h9GGztYRFvNKXpg==; 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=6smFrs0VP8ZslfZNhouM0qgSR9a32ZIwFLqDz4E2F4o=; b=NUdvwWGTh7/9OWUN5dBLHP0n6o xNUNgNEeVKCPAeg9nr9jPD8zf0s0uVB26za274S/uSi5WGNjSiyzkFHiieVWm+UZzZaWQaF+nlnhv 5nq+v8kA4bSGP4cHE5n0k5kQTopup2O72lsHFQgjx3spGXehGv97be7HRPAzxZ+Dx7JsawksKxGGR VG09FSrv/d7s+OiKKZ2joysJ+vmMiVCfz73yRoCw1j/xrmKJ0Df+tMPSMKiNJNDGyzuF2gwwO4+DN 7R4paJa0Lj9iB05nexUlav8pHbrtONQg5xQmCkrlwlQSpV+N9eLzq0VKIo4k1ZSphMrSZQoQKwn7i eeByHLjQ==; Received: from authenticated user by zero.zsh.org with local id 1nnRD7-000BaD-Ci; Sat, 07 May 2022 20:39:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; 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-f51.google.com ([209.85.208.51]:41639) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nnRCr-000BFa-Ir; Sat, 07 May 2022 20:39:14 +0000 Received: by mail-ed1-f51.google.com with SMTP id d6so12155034ede.8 for ; Sat, 07 May 2022 13:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6smFrs0VP8ZslfZNhouM0qgSR9a32ZIwFLqDz4E2F4o=; b=kH8816VCDzCuLFw9rHwUDZJpcfgofDowSUmbL4NUOyaWd9+qHa/KPiITzenI5SL8Iy XiXnWcebzUMfT5ygysAc2V+ubRT1FeprTTkg1tJLufogPw9MX6c7ZAS5qXZraXuo9XWH Cc5pmRcEUvzAKE+ZjN7w/WkMUruC/K6KlsY3NtithIcwKS4mqsOKSVWRw+BhyXe4RnOJ JFdy6sC2mp1tscOlctFHDSs1fd0eP98bQbtLe1LuUBIVLvw/7q9+WV2vzlbDz89XAgHM 8M0dGnPWhCBwDfHelBVi7QhNk1Jt8fWEsOYgm50k5Of0Mg+evPElKXcWAVdz0ZZNGjw+ tuUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6smFrs0VP8ZslfZNhouM0qgSR9a32ZIwFLqDz4E2F4o=; b=39hd1T6wwHWBc6FOdcpeqAQ2YyTTChj/Uew6ArnKqqID+0Wu9qLctBA+qLIr9xahkB aeNmCZU/5PZGhNbVwILcmIBfberH8+vV/WpVsWoozLs1kxUlcBoLLMI7lPAqi+Xroa1S 2CaoOYJisr1sU14WCINyt7RSk8mpznPVcoMnhiBeEAS/UgLxJmCgRjS8n2ip89Xqsdf/ XMbRlUYLhSWPP/m/B9I1hDQcte4Cy9WCfP/UcdvnxFG+HQVFXI2C90JuXKydJXWGKAr0 hStTjIN7XGWR4wrcJrO+VnaEf1Wmp2Polx5kVB5uzwEO0VTOatuRqXMFXDoveqX2hUdR EZog== X-Gm-Message-State: AOAM530jCjS2gEaPey0sWF24YGTC1HbY5SumeT7yjfaQ8p9Irk/FGmYD 3zJgopzMxkIV7uCj8/7Ci1QXkd7Eebg2EBWibHsxMQ== X-Google-Smtp-Source: ABdhPJzHBkXMo2tbnn4KwNkokywGtoSsgsUK+1eS8abbvuPgpJ1/CTZUhc5VWmml4ieNpw1AJ67lHiWaX8euGb3BoMs= X-Received: by 2002:aa7:c49a:0:b0:425:d526:98ad with SMTP id m26-20020aa7c49a000000b00425d52698admr10066194edq.352.1651955953300; Sat, 07 May 2022 13:39:13 -0700 (PDT) MIME-Version: 1.0 References: <36227-1622676235.815398@zrY_.ZerV.zhJL> <906332f9-027b-4b21-bb7f-3fd7118154af@www.fastmail.com> <38d114d9-d4fc-4f50-bc55-2f8402ee126c@www.fastmail.com> In-Reply-To: From: Bart Schaefer Date: Sat, 7 May 2022 13:39:01 -0700 Message-ID: Subject: Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer) To: Marlon Richert Cc: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= , Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000c8095b05de71f7e9" X-Seq: 50183 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: --000000000000c8095b05de71f7e9 Content-Type: text/plain; charset="UTF-8" On Thu, May 5, 2022 at 10:58 PM Marlon Richert wrote: > On Fri, Apr 1, 2022 at 3:37 AM Bart Schaefer > wrote: > > Furthermore, the behavior is a bit odd. With the patch, given an > > alias named "xyz", and completer style _expand _complete, if you type > > TAB after "xy" you get "xyz " (with trailing space). Since TAB after > > "xyz" yields the the value of the alias, the added space feels wrong; > > I don't like the way the space is added either, but it worked like > that before, too. But before it was arguably correct, because you're completing a command, not performing an expansion; theoretically there's nothing left to do to the word after it completes. > I suppose it's better to be offered as part of > completing aliases, but listed separately, after the actual alias > completions. > This is tricky, because if you complete (rather than expand) to a value that has multiple shell words, you can't enter normal menu completion -- the next TAB will find that the line has new words on it and start a new completion in that context. Which might be the behavior you want here, but would definitely need to be a style setting. --000000000000c8095b05de71f7e9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, May 5, 2022 at 10:58 PM Marlon Ri= chert <marlon.richert@gmail.= com> wrote:
On Fri, Apr 1, 2022 at 3:37 AM Bart Schaefer = <schaefer= @brasslantern.com> wrote:
> Furthermore, the behavior is a bit= odd.=C2=A0 With the patch, given an
> alias named "xyz", and completer style _expand _complete, if= you type
> TAB after "xy" you get "xyz " (with trailing space= ).=C2=A0 Since TAB after
> "xyz" yields the the value of the alias, the added space fee= ls wrong;

I don't like the way the space is added either, but it worked like
that before, too.

But before it was arguabl= y correct, because you're completing a command, not performing an expan= sion; theoretically there's nothing left to do to the word after it com= pletes.
=C2=A0
I suppose it's better to be offered as part of
completing aliases, but listed separately, after the actual alias
completions.

This is tricky, because if= you complete (rather than expand) to a value that has multiple shell words= , you can't enter normal menu completion -- the next TAB will find that= the line has new words on it and start a new completion in that context.= =C2=A0 Which might be the behavior you want here, but would definitely need= to be a style setting.
--000000000000c8095b05de71f7e9--