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,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29865 invoked from network); 1 Apr 2022 00:38:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Apr 2022 00:38:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1648773492; b=rQqkk9QSoULa1XewMNF9eqL+oDTF9H0nxsX2b/3x1O80WpyhU47rIw1VyoLbSIvBCAJ/eirH2F FwCMhI6QFb+NqQsEfaOYxoxUvUt4ErxC4e3frfOPjcdawmnOYoihH//wbvaQPUICwoqux/cpyT XfijDNIjZ3FYEygYscpcE48ocbsiiZC20kBN3X3E4gU2VEqmF/xKY4BLWKIRyPF5TLwH+MAWoy 5YCxd3sqnpVm5CoiMGM/xcVxkIigFo6FeVzt63QtYdKxnlrQ6Gcu8deAQfRnTGJHXlNlf5p9tr n/bMcZoNyLVyNm6WfZrganKoL/w0IP/l7I70PQeu/egeEg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f45.google.com) smtp.remote-ip=209.85.167.45; 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=1648773492; bh=E4iuCvbdQLfnSSonhoaPbO2W3rFF7DSosjBdb1tC9Y8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=autziXHo9Cucp7VhyiZ4HsYsK8NkF1MpJBMgVhGt5PJq8jBCtVxIKgBkbpbdHWTjkGNrvgZy2z cK7SLFYiB6PaEslZ2skEtWw4PDQQLwwuiDRVdtZrQGNNtY7Xhx8nDwqcpf3HtEpj99YecetL5i LJc406yjzZCAP1g04HIYgJ/Scwrh2WrInYzwYa1olfG3TJN9+DUsOBs2ktHhG5Fbg5Dn/x6mVF aiZELbdANJkOlMzxAEYn+cPGJDu2k4Mc0tv9aDjyU7StiJp+vrvZjpAyQaxxQZilrAARJrOYLH rldNbuYYEfZ6BafEuSp5yha6skYZi/IExm47nvsg4OcoQQ==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=5PAOJUg+8EiThdRQKfPfqg8b73IK9aIQSpQl5GeOlo8=; b=NrPcWv4cVNk49KZa5BNoHvrcAw J35py3Hs1ngD3ycw9EpsBd7CBj1s43pfbu9X2n/RmbtIQpM2QM0izlcW51smdjG9LIlTTAbS/L5eZ m6ghwCS2OcjEQWgZEJIf8tOerTsp+uVNGTyCbHDVoIqa0b1eMS6M/a6J5SRyIKEZ/jGauTRBPYrR9 eftMQvAB67bkX4wghme8jF+NPTRMXeAXLmJThsJZbK6QaB4kmrPT0x8S6b3vBkShwDZZNRc4YnZeN SGK6dNTWVwm33sbTZcgcxzftsld2pM0262wTiwmThy4ycvXKOyv3ityBLa7Qp7CMm33/yB4nmKuP/ 5IEtgsfw==; Received: from authenticated user by zero.zsh.org with local id 1na5Ip-000J3C-Qk; Fri, 01 Apr 2022 00:38:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f45.google.com) smtp.remote-ip=209.85.167.45; 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-lf1-f45.google.com ([209.85.167.45]:44950) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1na5I8-000IiX-C5; Fri, 01 Apr 2022 00:37:29 +0000 Received: by mail-lf1-f45.google.com with SMTP id m3so2020268lfj.11 for ; Thu, 31 Mar 2022 17:37:28 -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:content-transfer-encoding; bh=5PAOJUg+8EiThdRQKfPfqg8b73IK9aIQSpQl5GeOlo8=; b=bHdmDy64QM6yK3adzlcHjsYh2mM2533pdY14SnjbKFR2o3ory/DSXWBytpcwEoVvEK pbWUVPhF5O4SzKcKuzfzphopu//ASogXxj0cUyvSWi4/gU11RE9P43dSu8XSezey4hT0 oXRw4Ub3TQvm/IyOMOb3gDvSw5ebwXmSMD9b3PQOEEn3C000OWVfZSVxoSzp6eZ5iyFS bx7hXeiCAZWjQALsGaDr99vtE4t53mPyUnJS9AvuSRVPDlkvJwulvdkJr88rkGfp7HI0 TiT/qD6jlLwXOw3kZkx7Wl6tmSXTfF5DFsENEpW/im9ba/IWHrga4/S2mohBAI8zPCxK M77A== 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:content-transfer-encoding; bh=5PAOJUg+8EiThdRQKfPfqg8b73IK9aIQSpQl5GeOlo8=; b=BokI2FNAWb+QfUHYkJpotoxya6xofddqIXdzkY3SbxSO2TuSkur4hxieYJYQyiTXIL WZkoQZksBTK0ICdY7kDji273ZvpkKqWmSsX/f+Q6UUacOG05H2qZPOdKsK7IXbPfyM5i WbqUc3NhMih4TFfjonTzp9k9wbyjZ9kRJSgKwcdl/Lh1Hf2Wn3rHm81k+IZ/2LmJ/Oll G5wIO+EMqaq6EhoqCWwGYwLL/ezdmt2Vo0iX1YOjYNS+MVTL7ZiW7csGBPfcylDm2MpP JBNDx6TpOcGlFLJ/qV7k/hx0F2KAmjdvQYErdXJay3WaVZCn7MG/wGdrypc7MmrEeMdi phgw== X-Gm-Message-State: AOAM5320XQgGulLJMEHWMk7ry6bifMgKYhYLIsOQW3cUdRTJij1Qx+vb dERufF6xTq0kniYBLlTdz4Sko88wURUckXDRyw2iFg== X-Google-Smtp-Source: ABdhPJxVoH1a3NQLIcvmMOafwUCojA4y+DIlMAADVo685WUCiY+AJx++xTlRiFqv+pCNyywucFa3Q3QxeJky1+4A68c= X-Received: by 2002:ac2:418c:0:b0:43e:8f98:98f0 with SMTP id z12-20020ac2418c000000b0043e8f9898f0mr13035003lfh.604.1648773447166; Thu, 31 Mar 2022 17:37:27 -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: <38d114d9-d4fc-4f50-bc55-2f8402ee126c@www.fastmail.com> From: Bart Schaefer Date: Thu, 31 Mar 2022 17:37:15 -0700 Message-ID: Subject: Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer) To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: Zsh hackers list , Marlon Richert Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 49951 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, Mar 31, 2022 at 3:36 PM Lawrence Vel=C3=A1zquez wr= ote: > > On Sun, Aug 1, 2021, at 2:50 PM, Marlon Richert wrote: > > Alright, here's a new patch, which moves the alias expansion code from > > _expand_alias to _expand (and refactors it) and deprecates > > _expand_alias's use as a completer. I also updated the documentation > > and added tests. > > *bump* I'm uncomfortable with the change that expanding aliases in command position is the default behavior of _expand. It never did this before. It means that if there is an alias that is the prefix of another command name, expanding that alias will take precedence over completing the suffix, which i think is an undesirable effect as a new default. 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; the first TAB should stop before the space is appended so a second TAB can do the expanding. Perhaps there's a combination of the supported styles that provides this behavior, I didn't dig into it very far.