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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23339 invoked from network); 14 Nov 2021 13:03:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Nov 2021 13:03:01 -0000 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:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=TMy/BhUYG5xkLNxHXVCnueE8tRH3wOwq9KOvkNqxP3w=; b=fm0XBG29eXRH6pHTcZKhZBpx9l F0iBMcXbTLL22g6y+wn95c6lMPpA7uGnzYgeYnHbCi/A4Qx0S9DCi4Uh4y6O+swZuCrrhaQC6wotg R6+KR6T3LbOT+CHIX67FJfkgHrdjr2+i0RYKt1JhyLwSc0usc1JgytnY2qekNOiyT8jhvXKzezc+t vJTZpM/sM4EG500P1nr2bAzl1d7dqJNtnWShWXXR6bpfFaEpbgsf3hWAbjuu8o/G8NbZHCqb10q6b tOlu+OCs6Z62fbsj7TMXGZ1yetwEM9DeSvS1KJlFR9TIpYN8E05O62KBIdfizjPz8QTWcSxax/auH uaEQ3gbw==; Received: from authenticated user by zero.zsh.org with local id 1mmF9v-0004D7-I6; Sun, 14 Nov 2021 13:02:59 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mmF9X-0003Vn-RL; Sun, 14 Nov 2021 13:02:36 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1mmF9W-000JbF-Dz; Sun, 14 Nov 2021 14:02:34 +0100 cc: Marlon Richert , Mikael Magnusson , Zsh hackers list In-reply-to: From: Oliver Kiddle References: To: Bart Schaefer Subject: Re: [PATCH] Don't complete escaped words as aliases MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <75343.1636894954.1@hydra> Date: Sun, 14 Nov 2021 14:02:34 +0100 Message-ID: <75344-1636894954.430445@bbTu.fE6Q.VZqQ> X-Seq: 49585 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: Bart Schaefer wrote: > On Sat, Nov 13, 2021 at 9:18 AM Marlon Richert wrote: > > > > Would this be preferable? I can make that change. No other > > alternatives come to mind right now. That approach would also have the effect of adding back in to $PREFIX characters that were shifted off to $IPREFIX. Another option might be to filter out just quoted aliases and complete only them: aq=( "${(@Qk)aliases}" ) print -lr -- "${(@k)aliases:|aq}" > Hm, it seems as though what's really needed here is for the completion > internals to compare the full quoted word to the set of matches, > rather than remove the quoting first. Skipping the completion because > the word is quoted is at best a workaround. > > I suppose that would need a new option to compadd. It might help in Intuitively I would think this should be an additional effect of the existing -Q option. > some other edge cases as well -- lots of completion bugs arise from > the internals attempting to properly remove and restore quoting. The trouble is that completion fully strips quotes and parses the command-line into words very early on. There's no getting the original form back, at least not in a way where you know which character corresponds to which. It would needed a layer of abstraction such as a rope data structure when unquoting. Oliver