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 25574 invoked from network); 7 May 2022 20:57:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 May 2022 20:57:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1651957059; b=ZwzosdoEfmfOB0qWBrBuv59o0vAYgCWsCePyp2+X7VeAvUCfkFd56b3po5su18TZeFMDORiLVp EBfNpJD0PCdEsFgDztCqoZ3sHt2ZbuTOy+Qvu9mUciEwynZeq0q4prrsM/1TbrkrfHazGf1PXh soeIpOZtxCZGs8+518lUr2Elzkbl9y14uAzXHnNSEG4TRRInRlSCaNurjY2Px+TD9PSIzBoj3g cwISxoFWH+Jmib8KewG+qe2Svno+NhMGWG2eqZd4G9zWtV5TvK2kLKD8ZDwQ41op+TmKk4/Urv zmIEOd3GOENRz79mISR2q0o5a0ULsWSyK8F172wDBN0Dng==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f52.google.com) smtp.remote-ip=209.85.166.52; 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=1651957059; bh=rsnSkoo8yj5vmyU7ssY7xMHM9Zpsh/YwYNIVv4ZEBO4=; 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=A4K07/8UDwaXLh5wFyBBVBEM8/VGNs5fJlg6Ki4+U0L+SQKMwfIMQLg4PR3zn3ucwvJuxAvs/n ZQeQaNAwvLQbap+Yz0JkA0L3AG3XQmdLaLEZHjWCqZWirBeA+4Dt7V6aZZkCTUzPn/Oz6HQX77 NbtybT2tbZr6WgdtRnKYUDNRISsrKG2S73WrZwerFbWnXE8ZZ2tC5ggqVnq0RAlviL4sZnZYyp 2nkoV6sKOne+HJoaSGxL0CNUB47hfJ6r4+WRKbi3n+B6I9aH8FuOiTcttoOuje8gDZ7D9CupZS msiGs4/D5KXKXZwJy/MXgX4iy155WTO3ktcaGGR2K+nmlw==; 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=gu2SJh4KTu4GgH4ES2AvW8bZP6O78NWqOn8KNXTjWdY=; b=qm14ER/mqJDTcAPgyNgPXNXw0G aNY2mFWaDa/P2nul1AOUr2LkJ3gjYzWA+B9X85VTAzQBk7XjVd6M5+P+EkKh6q5sUhulrqYLE+RdZ bgBYVpNdtrWJYZ/2RuCYqYENHrAPjSwJBcH+6BtPa+873JSrElDow6t8OQgBgH2Dp+fTFpoo+NqmS V+knrU8rYwoHgdPdT2oSdO+nPOs4nA72+Sal7Z8Ku056FQBZC2jVIdZz+mMNmKJqFcZBS6TNrfni8 bQoqxrZALdKNui71xin1RCaSQrphE2LQWY2klL3+i/cCknO8dknaPIiPisWTdhw4gm38z/lNNwqDf 7NWTWUJA==; Received: from authenticated user by zero.zsh.org with local id 1nnRUh-000Czm-Fg; Sat, 07 May 2022 20:57:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f52.google.com) smtp.remote-ip=209.85.166.52; 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-f52.google.com ([209.85.166.52]:33320) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nnRU5-000CJa-VR; Sat, 07 May 2022 20:57:02 +0000 Received: by mail-io1-f52.google.com with SMTP id i20so11548475ion.0 for ; Sat, 07 May 2022 13:57:01 -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=gu2SJh4KTu4GgH4ES2AvW8bZP6O78NWqOn8KNXTjWdY=; b=dP5IPGNZjsbggdnSd4qf0GA4yj0YbllLCuPyCEIKD0dfqhQSzl9rHfAfAS0cXlXht0 Szz1Cyjf6SvVFcpzM227jk2yxJ7kMUElwDdAJkifzpb4II+wB4saX7xG0VPM4a7qnFZ7 vg3tzIMVmtoOQbIwQxbNfwsq6cwYi+fMD4eq9yGpJ4+edMsANggmqEzVpF6yNVxz/DRx 9kDnjurijwr1hYGGC9TqpzIu/OUMnjJF9cgqo8dN5XGl6RMs2sHn9enJ4B1QkYIjY6BM cDG7DnQIo+un6efMPLxugKUN5BfkFznAv2Pezr/4XIHGl977pEcm178H/4vquy1velK9 kjOA== 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=gu2SJh4KTu4GgH4ES2AvW8bZP6O78NWqOn8KNXTjWdY=; b=omwqFHEVrrB6RqqsjBR/B8y2TuiFC276WOqjK3GQoDg6G/Jth50jqj0Twl2Cc5edZL DStCzqiJJOe+YvAwmrX0HoI+ikCFQN7hjJQQewbbhQyCNE+unZbO4zei58xkHahPZTBz s+uQ285+nHNtwrw2CqQTlAX9u0dhmF3Hk8KkyqVUu23K2NJWDZk3H2uicRPo1HqbpM7R wj/MaUbp/gh6eHLmWGCzd1NSgG8Q80GbO+8c3AguSp2bz7HIRGX+LEAmrhxzGUAzE0Jd Rg3UwMfZWS7HfsqLz754fA3mznB2mbBLp76qh9kBNa7zxaiy3pqZ7ja/eUqSAp8nNEew zXVQ== X-Gm-Message-State: AOAM533h4PQ5YfFvlWdC0Tjy7QtUtUwZTu71k7fLDFNlMo0dMHtlfias SHWTy0PrEGMfMLjOLsN3jXCV198em9y73tHb6waWxWiPCbQ= X-Google-Smtp-Source: ABdhPJwtSCaYeJQ5k7pEX0JizZs86uCdM1/G0dpltIMy1tZhnCUw9gXsV2Dnn9jdyYJpGt72wLEzMMiMiSVy0q1lS7Q= X-Received: by 2002:a05:6638:1343:b0:32b:de4f:686e with SMTP id u3-20020a056638134300b0032bde4f686emr1484649jad.72.1651957020755; Sat, 07 May 2022 13:57:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Sat, 7 May 2022 22:56:23 +0200 Message-ID: Subject: Re: completion with separator To: Bart Schaefer Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000680a8e05de72372a" X-Seq: 27736 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: --000000000000680a8e05de72372a Content-Type: text/plain; charset="UTF-8" I found the specification of _arguments that describes the action part. I don't understand, however, why the -r applies only to these, since the compadd specification of this option does not describe this limitation Pier Paolo Grassi Il giorno sab 7 mag 2022 alle ore 22:31 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > 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). >>> >>> >>> --000000000000680a8e05de72372a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I found the specification of _arguments that describes the= action part.
I don't understand, however, why the -r applies only = to these, since the compadd=C2=A0specification=C2=A0of this option does not= describe this limitation

Pier Paolo Grassi
<= /div>


Il giorno sab 7 mag 2022= alle ore 22:31 Pier Paolo Grassi <pierpaolog@gmail.com> ha scritto:
I would like to test your solu= tion, 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 Grassi


Il giorno sab 7 mag 2022 alle ore 22:29 Pier Paolo Grassi= <pierpaolog@g= mail.com> ha scritto:
> It should already be happening that way.= =C2=A0 If you type a space or another return after the comma, it should dis= appear.

yes it is removed when I press a space afte= r selection, and even if I press enter after the selection. But this way, i= n 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 lik= e 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<curs= or>

instead of=C2=A0

<= /div>
func acat,<cursor>

thanks


Pier Paolo Grassi

<= /div>

Il giorno sab 7 mag 2022 alle ore 22:12 Bart Schaefer <schaefer@brasslantern.co= m> 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 wou= ld like that the comma was not added automatically, or at least to be remov= ed automatically when I select a voice in menu selection with enter.
<= div>is this possible?

It = should already be happening that way.=C2=A0 If you type a space or another = return after the comma, it should disappear.

If th= at's not happening the way you like, you can try some variation of
<= /div>

remove_comma=3D(-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 ha= ve an "action" component).


--000000000000680a8e05de72372a--