zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: How to overcome the (a/b/c…)(N) pattern limitation?
Date: Sat, 18 Apr 2020 17:02:20 -0700	[thread overview]
Message-ID: <CAH+w=7bZ=7V6bU74xxUTcCnt_2Z2cm12Gj=ceg-RxwSSBiuQ0Q@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVDZQgh7NA2riRH9+Hm0gYm52YGNbLsy_SmtkA2o7pcLVA@mail.gmail.com>

On Sat, Apr 18, 2020 at 4:24 PM Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> On Sat, 18 Apr 2020 at 22:00, Bart Schaefer <schaefer@brasslantern.com> wrote:
>>
>> In this case, "useful" collides directly with "practical" given the
>> semantics of "/" imposed by the underlying file system.
>
> What do you mean?

I mean that given a directory tree a/b/c/d/e/f, you can't do
opendir("a/b/c") and then get back "d/e/f" from readdir(), whereas
every other pattern can be compared directly against a value returned
by readdir().

>  it puzzled me that such /-using patterns aren't allowed. Mikachu has a patch allowing them, maybe it's worth adding it to the upstream?:
>
> http://comm.it.cx/cgit/zsh-cvs/commit/?h=mika&id=512bd3f23ea8b4170d88582521d417cdb247413a

I don't think that actually does what you want.  This works:

% setopt jankypatterns
% ls -d (Completion/Base/Core|Completion/X/Type)
Completion/Base/Core    Completion/X/Type

But this doesn't:

% ls -d */(Base/Core|X/Type)
zsh: bad pattern: */(Base/Core|X/Type)
% ls -d (*/(Base/Core|X/Type))
zsh: no matches found: (*/(Base/Core|X/Type))

The latter failures are why Mikachu's patch is not presently suitable
for inclusion upstream.

  reply	other threads:[~2020-04-19  0:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 12:49 Sebastian Gniazdowski
2020-04-18 12:55 ` Roman Perepelitsa
2020-04-18 13:41   ` Sebastian Gniazdowski
2020-04-18 13:45     ` Roman Perepelitsa
2020-04-18 14:07       ` Sebastian Gniazdowski
2020-04-18 14:07         ` Sebastian Gniazdowski
2020-04-18 14:31         ` Roman Perepelitsa
2020-04-18 14:41           ` Sebastian Gniazdowski
2020-04-18 20:00             ` Bart Schaefer
2020-04-18 23:22               ` Sebastian Gniazdowski
2020-04-19  0:02                 ` Bart Schaefer [this message]
     [not found]   ` <CAKc7PVCJfCwUUrm5KXzzehxuX1JF=Bvwkh=m7we_TiCrtw_fhQ__30396.4317821496$1587217473$gmane$org@mail.gmail.com>
2020-04-19  6:44     ` Stephane Chazelas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bZ=7V6bU74xxUTcCnt_2Z2cm12Gj=ceg-RxwSSBiuQ0Q@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).