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,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22282 invoked from network); 7 May 2022 20:32:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 May 2022 20:32:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651955570; b=McmKaQ4l5EAbR/+RFBRZBJp8L8sQY0n/xi+OUZwoszS5xdOlqh9e0LxukOJf543n4W//LYH8mk RHdv9wTiaLvOgTGjdREyXgTTvalQyieGS5KCYfh9hMyMsOXMf93pDtMRTNbkf5TzePq4Hv/dzS Zk7ohoR1+2+eVsiERYBMWtHLpFQ3+t64inBwHuYBNctO70oGTNRST/ewNMU80aNEtfWGIOO/sy wICPoEVhphQG6tko3hFcyg+2dRy7Jh3q4R82ndKCS60DEq2Q5aD4THOpRhEqyLrToXKQ3zeAI5 e7VYjjuCNXOKNWE5W0YAOIn8vocG10SOmwFCoU/4komqHA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f50.google.com) smtp.remote-ip=209.85.166.50; 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=1651955570; bh=AnjlxLn4tI1aQokGj+KfKmZR7p0LqEBMvNlnGqALDxg=; 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=oR9Z2H59K3O0x8N9I9yZp0MGefMnq8gq30h99MultnIQlsoEVvVixUh4GyZlOFLA6iMZqkV5JB qcRLazUFoZ9HfFPXlauRKYXkjdxQlk/qrz6zXD2iSIFhkTEOS2wvAUScUdq35kSRLRiSILaFbM P3TnDGMAuQYmKOoZD8bXbUzWIke/v3R/AwJdX1C7hjYGTyLC2DjnolpL1+PNbfBMEPCx6saLP0 x8j0ysfOfgCjqo/cwopFfLUUIDqa100grfHW1dizESNSr5hL8IIwMLeTMrb1p0/Ohbyc89ZYqg bUVBzkYaIX7In8FjorgeYQvMuUHs0U5ZhbarFwL6IcvuxA==; 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=ONCd9JP47XLJ2vfSINZNV+2scWKLbAA64WQkjWQD8UE=; b=ZsA2dj94IeDrpdLq4/xzbSgYox LDuuwmDVqGAWO4Oh45DjLDJusPv2LMU8F9FxRGE6i67lFbvCj/5zlOiPw5DsuP1tPpFyugOCu08AK FrmsCdQdFAysHw1e+ZYZXeHWyajo4siaY9N3UjB0erhcnz2E/5dDyf3lGmVoP0Aw9hGk34lUTfK72 Pq9Ny3IuZ1+yD7yYJQsum4WQ31aQK/fCXUzKNMwQ1u+vzaUd+VGkIIqvEENpIxPq7P+w3lqmwrqqp eCWU4fCmKeEg78QOQ6eQK50BpsnETMoXMt8ww8kJbOsBFK+NV1WiUNHKENkMMaXjrQZjdUxgtO46Y ooXNl4xQ==; Received: from authenticated user by zero.zsh.org with local id 1nnR6f-000AdU-RG; Sat, 07 May 2022 20:32:49 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f50.google.com) smtp.remote-ip=209.85.166.50; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f50.google.com ([209.85.166.50]:38482) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nnR67-0009vY-WC; Sat, 07 May 2022 20:32:16 +0000 Received: by mail-io1-f50.google.com with SMTP id z18so11504967iob.5 for ; Sat, 07 May 2022 13:32:15 -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=ONCd9JP47XLJ2vfSINZNV+2scWKLbAA64WQkjWQD8UE=; b=knxjoBIPkrIUfsxq7CC1BtbuGUouljOH3G4fTG2S/qCYOo0J7V2IHPYyM9dmsS3q96 XstQBPiqgBnTD+eSoZr1hpHyWVO4CPFfzG0b+NlphKlD53/9WzmrT0jd4pnH/tH9r4Yy mywP/vZMYirZBGz31ZVZ3xSFSLHfjeFf1UgZLDpv5BxM2zlmvBI1Odi+HwgVE2pL1bl8 5+Vo+afdBKbjcAuwAr3fY7nTdVbLZ8KnSac2UsKNt/lryZ/kZMvjCMPrfbez6frX4zbW XnDIIWBOKO1yUltLJpNc9FKqDA/d1sWQPCmrMh8pRiYLeXkFF7oRjBL3Oc5ODHN8qeff cvYA== 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=ONCd9JP47XLJ2vfSINZNV+2scWKLbAA64WQkjWQD8UE=; b=LOdNy5czMywpxmlUp+NpupsMAt8MetoTq3xO1pTbr9iY5V6fRLYy9eNp7xRwijBNLE uUnUoI51vYfHzHFvvSNgHLgu37FjW3Mysh0DgzhD0TvFb0p77/1+qOwrlTZx2ZZfxSYc NBy8O8OhiBhN+qq27eMyThy5VR7YowCasWoFKLFfxPBwu9N1h6S1TmOwLvBYyft6HyIq /pVRCEcDKPyxsiQLWq+Enbo6Ux+tSf4dL8tPvLksc1y2BWsg+tY5+4GI8CxCE8MjTSnf 9iHmApmE+s/ndG5yNSOASpET9V7uHfy3Unn8Rw/i6/M/MElJL6Qbph7tlOFQqQ4+X3tr NAvA== X-Gm-Message-State: AOAM532gyxkvpgBxtUo683NZnA+ilIMMm53FPphFvqJtE1lnKJ9R1pHx 2ux7CoxrRfPhdZuykah5k1sK7t6jV9Sd2V1p+fVkAaXTvOStEA== X-Google-Smtp-Source: ABdhPJyZGALPl3NJp7NX8ikAhh7687u1nspB+LvSmRwQow4YSkUeJ7UmyvM+fYpsckUIDRZduwu5Mqt8CtyG1T89vKU= X-Received: by 2002:a05:6638:dc7:b0:32b:a483:16b8 with SMTP id m7-20020a0566380dc700b0032ba48316b8mr4246747jaj.66.1651955534808; Sat, 07 May 2022 13:32:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Sat, 7 May 2022 22:31:38 +0200 Message-ID: Subject: Re: completion with separator To: Bart Schaefer Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000d648b005de71dee6" X-Seq: 27735 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000d648b005de71dee6 Content-Type: text/plain; charset="UTF-8" I would like to test your solution, but idk how to add an action part to my $categories_array. Right now it is just an array of strings to be used for completion. Pier Paolo Grassi Il giorno sab 7 mag 2022 alle ore 22:29 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > > It should already be happening that way. If you type a space or another > return after the comma, it should disappear. > > yes it is removed when I press a space after selection, and even if I > press enter after the selection. But this way, in the enter case, the line > is accepted and executed. > What I would like is for the comma not to be inserted after the > completion, I would like to insert it by myself if I want to insert > multiple arguments. So when I press enter in the menu selection the voice > is selected and the line is: > > func acat > > instead of > > func acat, > > thanks > > > Pier Paolo Grassi > > > Il giorno sab 7 mag 2022 alle ore 22:12 Bart Schaefer < > schaefer@brasslantern.com> ha scritto: > >> On Sat, May 7, 2022 at 3:41 AM Pier Paolo Grassi >> wrote: >> >>> >>> _values -s , categories $categories_array >>> >>> > func a >>> >>> > func acat, >>> >>> I would like that the comma was not added automatically, or at least to >>> be removed automatically when I select a voice in menu selection with enter. >>> is this possible? >>> >> >> It should already be happening that way. If you type a space or another >> return after the comma, it should disappear. >> >> If that's not happening the way you like, you can try some variation of >> >> remove_comma=(-r '[:alnum:] \t\n\-') >> _values -O remove_comma -s , categories $categories_array >> >> to remove the comma when you type (in that example) anything alphanumeric >> or whitespace, but whether that works depends on how you've defined the >> specs in $categories_array (-O applies only to specs that have an "action" >> component). >> >> >> --000000000000d648b005de71dee6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I would like to test your solution, but idk how to add an = action part to my=C2=A0$categories_array. Right now it is just an array of = strings to be used for completion.

Pier Paolo Gras= si


Il giorno sab 7 mag 202= 2 alle ore 22:29 Pier Paolo Grassi <pierpaolog@gmail.com> ha scritto:
> It should already be hap= pening that way.=C2=A0 If you type a space or another return after the comm= a, it should disappear.

yes it is removed when I pr= ess a space after selection, and even if I press enter after the selection.= But this way, in the enter case, the line is accepted and executed.
<= div>What I would like is for the comma not to be inserted after the complet= ion, I would like to insert it by myself if I want to insert multiple argum= ents. So when I press enter in the menu selection the voice is selected and= the line is:

f= unc acat<cursor>

instead of=C2=A0=

func acat,<= cursor>

thanks

<= div>
Pier Paolo Grassi
<= /div>


Il giorno sab 7 mag 2022 alle ore 22:12 Bart Schaefer = <schaefer= @brasslantern.com> ha scritto:
On Sat, May 7, 2022= at 3:41 AM Pier Paolo Grassi <pierpaolog@gmail.com> wrote:

_values -s , categories $categories_array

=
> func a<tab>
<menu completion where I select a = value with enter>
> func acat,<cursor>

=
I would like that the comma was not added automatically, or at l= east to be removed automatically when I select a voice in menu selection wi= th enter.
is this possible?
It should already be happening that way.=C2=A0 If you type a s= pace or another return after the comma, it should disappear.

=
If that's not happening the way you like, you can try some v= ariation of

remove_comma=3D(-r '[:alnum:] = \t\n\-')
_values -O remove_comma -s , categories $categories_= array

to remove the comma when you type (in that e= xample) anything alphanumeric or whitespace, but whether that works depends= on how you've defined the specs in $categories_array (-O applies only = to specs that have an "action" component).


--000000000000d648b005de71dee6--