From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19887 invoked by alias); 28 Sep 2016 19:28:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39486 Received: (qmail 5067 invoked from network); 28 Sep 2016 19:28:14 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f176.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.176):SA:0(0.0/5.0):. Processed in 7.497243 secs); 28 Sep 2016 19:28:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=YF+J5P7vHRAYG9RmOtWmsSheHESubW3r5dARCj4LVIM=; b=xAvh9rq4HhAicVO9B9fImqK5UyYPF/8nI9P2fi93XLwfwqgZGaoBGOyztIyKMHShFU QC4oxFEzgagS7qRn/ZtN40UdiR9M2XHElnstCJ5Dc81jNvCsDJ2dqIPcjf40I/HvA4pt o6Phckz7j87LD2QfhzHxzRnTkENcm5PJ3tH5QYfH5GR85cIQpM/VH6yLGqXVgn25w8sd 8hZt4iIWCR0t7+PXgIb0AME8PTM/42Gw14RFe42IW9p6fu/JTm0aDaX04Vn/e13kmsY2 SOzzc4tqW2XX4kjOsTVyMV+cNxNGNqV1bYi+t9I0/EKO3Kap/KtVn63yLMuqZ3ztPmrI 9UVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=YF+J5P7vHRAYG9RmOtWmsSheHESubW3r5dARCj4LVIM=; b=jwhvIKcWGfoRAlW6SjjBO2HSSttuS6t0scvsJK7a33OpBj/zazHx2g/4Oo+4DWOV/x FP4UhsySAA1a9IfxoSvWBY4E25G7TYwNJ3nOo8fatM3YsbWCaPMR66ctiyc8MIsYsvCM dfE9f317vpi+RgyeooLiAfFWP3n8YdT9IgbTwEapUJlxl+Y+hmtqwvS4vvqmOQiv/obR hFNbxtRlNKAdoSiYpTYCaUEQ8nG6jeq3lthnLurr2LtIq4FKxDDx3sSFi7wMPkx6nir4 /gxBPucByk9Fk6iBlER7sIv1U8OdUklFv/C3NrinyI2OPddIY0To54tD/OWsAeKoQzjM zV9A== X-Gm-Message-State: AE9vXwPhDVWcgA0pGlJxa0SjYf+xp3UjV7kg8dQXHQdPz+2JQkoG/UWS0zpbjgm/zpztNA== X-Received: by 10.98.15.8 with SMTP id x8mr58960664pfi.141.1475090882626; Wed, 28 Sep 2016 12:28:02 -0700 (PDT) From: Bart Schaefer Message-Id: <160928122817.ZM32377@torch.brasslantern.com> Date: Wed, 28 Sep 2016 12:28:17 -0700 In-Reply-To: <1475084797-17029-1-git-send-email-danielsh@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "[PATCH] Completion: audit 'compset -P' calls to use shortest match where applicable, plus random drive-by tweaks." (Sep 28, 5:46pm) References: <1475084797-17029-1-git-send-email-danielsh@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH] Completion: audit 'compset -P' calls to use shortest match where applicable, plus random drive-by tweaks. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I'm going to leave it to others to say whether -P 1 is really correct in all of these cases. I have concerns about _lzop and _tail because the pattern semantics have actually been changed but I haven't looked closely to see if that matters. On Sep 28, 5:46pm, Daniel Shahaf wrote: } Subject: [PATCH] Completion: audit 'compset -P' calls to use shortest matc } } I'm not sure what to do about the handling of "_path_files -P foo": that -P } option documents its argument as a string but interprets it as a pattern. } Should we update the documentation to match the implementation, or vice-versa? That's this hunk: } if (( $#pfx )); then } + # ### Is it correct to interpret -P as a (greedy) pattern here? } compset -P "$pfx[2]" || pfxsfx=( "$pfx[@]" "$pfxsfx[@]" ) } fi I think it would be OK / correct to use ${(b)pfx[2]} there. Presumably if $pfx[2] doesn't literally match the filename, we're falling back to the pfxsfx assignment to resolve it later. Here in _cpio: } - if compset -P '*:'; then } - # TODO: doesn't need to be rsh. The TODO comment may have been meant to indicate there should be a zstyle to choose what remote shell program to use? Dumping the comment and forcing ssh might not be what was intended, but maybe it's OK, as it's consistent with what we do for remote shell pretty much everywhere else. In _rdesktop: } redir="${PREFIX%%:*}" } - if compset -P '*='; then } + if compset -P 1 '*='; then } curcontext="${curcontext%:*}:$redir" } - compset -P '*=' } case $redir in The old code does look suspicious, but does anyone know if it was doing two "compset"s intentionally?