Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Completion: audit 'compset -P' calls to use shortest match where applicable, plus random drive-by tweaks.
- X-seq: zsh-workers 39486
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Completion: audit 'compset -P' calls to use shortest match where applicable, plus random drive-by tweaks.
- Date: Wed, 28 Sep 2016 12:28:17 -0700
- 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==
- In-reply-to: <1475084797-17029-1-git-send-email-danielsh@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1475084797-17029-1-git-send-email-danielsh@fujitsu.shahaf.local2>
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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author