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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7730 invoked from network); 29 Nov 2023 19:56:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2023 19:56:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1701287806; b=dI7H/O2WGydNQEVFqbFdP9TxXNARN+u7X+nRYO1WZONSJZbcp5TU9CFNgUJubRW37aIme471i7 SyO1ro3o0+gYbyxlhTB04qCoP3JoXmO3XOc/d8YtyWtAgIv9YtS+fQpMGfsqslTy5uQTE52d5O GHVBws5ILIxOAqQohr839UzTLvnjzgdyndP3qKKgcDwWEDQddfw3ppCezZr5pka5BjciPzSvGN gxRZB9kmQqF2bPZ0nkZFv/kju48G8Twhq/r3wHCK5fRca8Zywx+TmWJjmnz6FRIJ6s6xMbXtY3 8sHZHF6u0vVZWR2Jy3Qk9D/Q5/fna5CN8DKh/3jPeQOmiw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=gmail.com header.s=20230601 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=1701287806; bh=WJHTYyA+6PYwKx1DMHvCwGeW/fiqkmSVGjjYcXPlKjI=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=j03GhiFaWIFFnp/0m9OUdVNfO6tvaGdYKD+R24Wq8fJw0wEfScXIPBDy/cTDFKy0ghTJednFu2 WSYuGPr02cGzNOzHnks0rbx/P40EK9uxRHpPhgq6AG8U1HiGNzNuYELCaeHyj63gVZ4Nje7yLM CY2SkWk7XZ7aw9dZP+fUyzJfzpAMZ3h4Oz2dR/L/9CoKV389rVBd/NM247r4g7+7sV6l6vRGqy eoyB+xuLrI+iyBe6CfXklIV8PEv1fXUtiDkr8MJqX2esHRyIg5VN9lqUyj1+UGinnYTDduw6HJ 69CM7DjW9JH5fGYGPloXoqD/KQIfj0YZWTJUGUF5xVlqWg==; 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:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=EHmfVkINp6yrz7vYXs87rVCTfhuGp3yn28pYpRBFpGw=; b=mu+QJ8GiCHCVuByqG+teZd7iQ/ A7xZZMAUqM/Q1KYCvoavIwoUrk8n5e17N6EmKHpMy2bk4IPIErkotuD07QLZZf1uoF3l5JXApoLan 2ff0xywKVtx/3wE77xWh/15n5SEF7szK/xr/goOcRWc3xVho2Jj/XrfdmobK6wUQV9vYH57dEF7+3 cHh6km8oSYWXL7kBT6RiE2nsW/0UeQsP/wbGGBL3Qny0VXtA4fT2Ran1Eu9Y4uRShoMWJAXcuiZuP sXn0UlQiBhKv4hffV1wxrNKBLEh+g7ULPNHm9KwGGFFDW7cdNnAb5LzfubrP/40cWieJuDwuKM8DV YQbGu6IQ==; Received: by zero.zsh.org with local id 1r8Qft-000El5-69; Wed, 29 Nov 2023 19:56:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f53.google.com ([209.85.218.53]:52720) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1r8Qfb-000ETX-40; Wed, 29 Nov 2023 19:56:28 +0000 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a08e4352992so20780466b.1 for ; Wed, 29 Nov 2023 11:56:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701287786; x=1701892586; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EHmfVkINp6yrz7vYXs87rVCTfhuGp3yn28pYpRBFpGw=; b=AiOLnapAxmYWkkz6gx5BvYYhTfikGu4lpSzfoJxO6CA1JZNdZrGfkfmhxDQksKu+Ng zCCC2GnpvN1q7H9ZPgj58bkOnbDE8ZENOZijVnQXhlYB//7Rhkr85+Ce47tdzJZcMrvv ZcWc1S8x8kEsdvNJMOXW30tTx0VV6HjiRZoitTSEvVnMxjk3hqwetQYylEkcykJkGyj0 RnR6Jyz0hyVn+fP6bO58HWfeBIxzDkEt8oiTl6fQWxG61nudgiGbs9P1pvr2C/pcxaug EcxpJRQbChafC5jcNkhQ2u1ZWkSUP8+27Jz6W2tDe8sgoFxJX1DEviyO5ex2248nuQTc frjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701287786; x=1701892586; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EHmfVkINp6yrz7vYXs87rVCTfhuGp3yn28pYpRBFpGw=; b=oSpji009K9h7xmZywwrWGpQsjQVCa9emYowZN1a7G/WtcyeutDlaySAoMQ1zKa0Qt8 1XwGYUmvWL1m79FHleeRpKuibxGAUpAFQB45wOHGgz8D6Wq1urqKIHXu1idBr9BES6Fy 6z2Brx2JkLee9j7cGrDqDGY1LzbIdQ+PQ8SXSX1uyB5q3M70Tk0jkH9tOgvltDIbZ4qj w7nI7VBxSpxEVO5wISN7yRk9a6NfcLdJaNjBcyGIl8NHN9aERpV7Tm5uLTGNRxyTwURv JXNIloo5kSCdJ6rzOKXqoin8RtCqDKU+z+XZLustlchD/YR89zKqA/TGs7EbnzXXpbsS rvOQ== X-Gm-Message-State: AOJu0YxGakTkcY0H4zl2BQtkdpI+smqzaYR0YcjVhOx19oKCaN47I3Lf 5ETYO/zwnEd/boCx3rFK9hcpgyBd63FOxuPps63naBsy X-Google-Smtp-Source: AGHT+IEjK+HZkCDyy0wSRNZuFbNAAJ7Mfo2m0nFI70pftzSDGP7lEfw9PJtnpQbWP61n3RkxYZ2EWLJ+ZRIrYikowNs= X-Received: by 2002:a17:906:a1c9:b0:9be:2b53:ac4d with SMTP id bx9-20020a170906a1c900b009be2b53ac4dmr13617519ejb.74.1701287786360; Wed, 29 Nov 2023 11:56:26 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:7208:b14f:b0:79:93b8:8fc6 with HTTP; Wed, 29 Nov 2023 11:56:25 -0800 (PST) In-Reply-To: References: <207461559.9336309.1701221332233.ref@mail.yahoo.com> <207461559.9336309.1701221332233@mail.yahoo.com> From: Mikael Magnusson Date: Wed, 29 Nov 2023 20:56:25 +0100 Message-ID: Subject: Re: PATCH: Improve quote handling in _ant completion To: Bart Schaefer Cc: German Riano , "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52337 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 11/29/23, Bart Schaefer wrote: > On Tue, Nov 28, 2023 at 5:30=E2=80=AFPM German Riano w= rote: >> >> In the current completion, if a task description contains a quote (') th= e >> completions do not render properly >> >> In this patch I propose to build the tmp array via >> tmp=3D( ${(f@)"$(command)"} ) >> and print one line at a time. > > Does this smaller change work instead? (I suspect the "eval" could be > eliminated by tweaking this further.) > > diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant > index 36c7c0e89..aea3f51ec 100644 > --- a/Completion/Unix/Command/_ant > +++ b/Completion/Unix/Command/_ant > @@ -122,7 +122,7 @@ case $state in > read default_target junk > fi > # Output target again indicating its the default one= . > - print -n "'${default_target}:(Default target) ' " > + print -rn -- "${(qq):-${default_target}:(Default > target) } " > ;; > > (Searching:*|Main:targets:|Subtargets:|BUILD:SUCCESSFUL|Total:time:*) > ;; > >> Also I am proposing to shield 'find_targets' with '(( >> $#functions[find_targets] )) ||' so that users can easily override the >> function. > > No particular objection to this, though I wonder if it should be tied > to the "targets" style and _call_program (Oliver?) It should probably also be renamed to _ant_find_targets or something similar, it's very unexpected that a completer pollutes the main function namespace. --=20 Mikael Magnusson