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 19511 invoked from network); 6 May 2022 05:58:34 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 May 2022 05:58:34 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651816714; b=lJC+X2OdJ858HCW4dOu6CTE7Iaj8Q8b9HC0JYN3qgLrtqE8c3ZII29K41nV27AJ6ZAuBqxLlVd TnnM3wQpp4YnKfBJgARGoK8SM1M8wG2L8Je/8g2VGA5mAKnXURioQGupzo/3FbreGp9VpQlsM+ Pk6Np2SyjvHx0oHLdJV+tLaxksaXR1KvNXhCMCFPz+2eh6UzO16YiVvKJnR30cFLvduVghQRu4 QgKLsXXhRlHtF/4Rs2U9hOVvWjvmhs2cVbj8M1FXrnETzFMN5hizmNY+jOlpCKv2pZFd8/G9S7 PmEgN0yb8PR+pZY9L27aIzeMq3+ndV7GEPDPye54Krat6g==; 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=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=1651816714; bh=Ydpoxk0TgPHKfi4jdHj2QyJF6HEwZcGySoxXv1YXKtQ=; 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=IQ3wJwRAXVqZ30ARf0hdgeowRtTO2FbbcLWPMBCOfq3dvNT22NT3qMmGGc/IQ/yXLT2oAKN8xi A2yQ7q3Nx3e04YSPkIMTo2azyxbXoCalrtNsSe9MU5pONUVgyt+Vb/vSDKVMS1kAwSDq0naJPR fGs8NSGZd2bMPbxNft0svvchE+neuTIKA9pqyvHryA5VwEVn1nykGdYUdT/stNnexLqf2nAJrp rDwS7+FJ79lRqe7sqQgw9mk/4jiOAiJd/cewxtEMMOeg8NWEcvyFj7vjS8X0JS/xJg0GiZ0NcQ nfn79rVzO2pb6rcZmaWvoRaHbp2JGtsEw53rXsRmP82NXw==; 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=J1eV/65PyMOYLoUdffcDTuNGGdg+RSSWYEtqxJd7CKo=; b=TQR/p3lIi8o6l7qVmspHeLpO68 XAJgWJ/FPVjzLEty9w7AbEIdXj64uEJfzrxtuCTxapz69+gfQxUyG3bPYlQGskUyMcEsOLfYE2se1 tTLWL6frqwxwyf694fkcdgp/sM6DIo7rCuT/z/peGVMOT6XrWUC8v11QIqgDVyvUvIWsh6QzM25lw hNWs0tMhZrsQNnYqTZKTvxl6mDw8Q0cm5XdD0atLP+uytdwxLJVaLVLBfURrkFv3FTTELGnyN8Dp+ GDPYeMGDgXGLoCSk78lOSrdMRtnJL8BrrqhEJMD0hdoECoSj7tRI2a730XDJunjglpRqF7Mn+uswF 69hDIZwA==; Received: from authenticated user by zero.zsh.org with local id 1nmqz3-00020M-LD; Fri, 06 May 2022 05:58:33 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f49.google.com ([209.85.208.49]:33608) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nmqyo-0001bs-OK; Fri, 06 May 2022 05:58:19 +0000 Received: by mail-ed1-f49.google.com with SMTP id p4so7529814edx.0; Thu, 05 May 2022 22:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J1eV/65PyMOYLoUdffcDTuNGGdg+RSSWYEtqxJd7CKo=; b=iNSDU2bcZ8LoPyziYCoInAF1qNKMidwXqLZmIlxcatCVDasHBhQeBf3nPqc7/xN3AF BybIZGQqxQW0+epn5KH0iGwAXJW2ta9DH/S/lDAeilPOha0bZ0LaAW351qMgGZEH3eRD neNoS0mCvkeMHDWjxVaFTlxiSu/dUJD049StlKOgWcGYQlDVLYnD7VrHm2oCbJycuDiH IwwJit+GWcU6HA/B7dd9KZxdE+L4XW/9FW73G3oPZjKLooTvAs9obXQjiB5OiOwWqH3I Yg83Zw3Gkd7yzJszN8aaoKJV2wWz8BaO/DgL0JwfzB8lXUw83Wsctf2Iw555jCksZR8i Cvvg== 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=J1eV/65PyMOYLoUdffcDTuNGGdg+RSSWYEtqxJd7CKo=; b=BjR1UYH1F9TwPXaWe8b2IcL8iIYmITwdTDKtFx8ljlrmcCCHgXGD1IIcunRquzMHJq Y7FP5NkZzVx44j/TKkklXkHpp4nlf5bV7kgsUK4EVcVFabu46SSv0pwzEr9AL02I3zQh yKwPb035mO1fSOpjDY5rIjysY3Q37a9xM+sgL95xtmiPKA9ep2qTB0Wk3g88z7ddLF9S IIxuxS3gZTB3V1wz86SVshpVvH4yD+mjIwGlX/RbhS578QbFomKshpQsk5SlJtGXni4X hfWmp9QY8ps1DxIu8hLW/ePZHNaYFZa4yPnvMKRrTjMiscPEdpGLLAGKlZVlNPQ9/j0I qZmw== X-Gm-Message-State: AOAM533Iw33DHeXhqGkEPqCuNAUsSEko076Tjev5LXCSD/R3ik+uYfpE epojHV52K8o1NgZJeXhiWNwNXncLJOKqLagSrhaFn7vr X-Google-Smtp-Source: ABdhPJzB1YqcW2pBF3amF8rnkLvEjptfnbNC5+UMbV1dtHiM4yFW+bP9joIxl73nM2hb4Fr2igzRiLQhTsI7fpzDp9A= X-Received: by 2002:aa7:d9c8:0:b0:428:364c:df2f with SMTP id v8-20020aa7d9c8000000b00428364cdf2fmr1800831eds.327.1651816698236; Thu, 05 May 2022 22:58:18 -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: Marlon Richert Date: Fri, 6 May 2022 08:57:42 +0300 Message-ID: Subject: Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer) To: Bart Schaefer Cc: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50175 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 Fri, Apr 1, 2022 at 3:37 AM Bart Schaefer wrote: > 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. Yes, I agree; that is indeed a problem. I hadn't considered that. > 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. I don't like the way the space is added either, but it worked like that before, too. I didn't want to change the logic. I think that's better left to a separate patch. In any case, perhaps moving alias expansion into _expand is not such a good idea after all. I suppose it's better to be offered as part of completing aliases, but listed separately, after the actual alias completions. Would it make more sense to fold alias expansion into _aliases?