zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] Re: (Y) modifier: up to N matches?
Date: Tue, 03 Jun 2014 23:42:29 -0700	[thread overview]
Message-ID: <140603234229.ZM29030@torch.brasslantern.com> (raw)
In-Reply-To: <20140604020804.GA2032@tarsus.local2>

On Jun 4,  2:08am, Daniel Shahaf wrote:
} Subject: [PATCH] Re: (Y) modifier: up to N matches?
} 
} Bart Schaefer wrote on Mon, Jun 02, 2014 at 20:46:03 -0700:
} > 
} > My concern is that people are going to expect the (o)/(O) qualifiers to
} > take effect before (Y) does, and will be confused about the "skipped"
} > files when it takes effect after.  If (Y) can't return more than one
} > result, there's nothing to sort.
} 
} The expectations about sorting are just as much of a problem with (Y) as
} they would be with (Y42): in both cases there might be "skipped" files.

Yes, but if there's only one it's pretty obvious why.  Consider that in
your doc update you wrote:
  +filenames.  If more than var(n) matches exist, only the first var(n)
  +matches in directory traversal order will be considered.

Yet those n filenames are returned in alphabetical order, which has no
relation to directory traversal order.  In fact, people might expect
(Od) to cause subdirectories to be "traversed" before files in the
current directory, which never happens with (Y).  It might even be
preferable if (Yn) implied (odoN).

I'll repeat that this isn't a major objection.

} FWIW, I'm intentionally making (Y) without argument an error; we can
} settle on its semantics later after (Y42) has seen some "in the field"
} use. The spelling (Y1) can be used instead.

I'm doubtful that any default semantic other than (Y1) will be useful.

As an aside, I'm now pondering whether this can be made usable with **/
to find n matches in every directory rather than the first n matches
in the whole tree.  **/*(e{'reply=($REPLY/*(NY3))'}) almost works but
doesn't include the current diretory.


  parent reply	other threads:[~2014-06-04  6:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 18:23 Daniel Shahaf
2014-06-03  3:46 ` Bart Schaefer
2014-06-04  2:08   ` [PATCH] " Daniel Shahaf
2014-06-04  6:01     ` Mikael Magnusson
2014-06-04  6:54       ` Bart Schaefer
2014-06-04  6:42     ` Bart Schaefer [this message]
2014-06-04  9:25       ` Peter Stephenson
2014-06-04 23:08       ` Daniel Shahaf
2014-06-04 23:16         ` Bart Schaefer
2014-06-05  4:45           ` Bart Schaefer
2014-06-05 23:24           ` Oliver Kiddle
2014-06-06  2:20             ` Bart Schaefer
2014-06-06  2:40               ` Daniel Shahaf
2014-06-06  2:45             ` Daniel Shahaf
2014-06-06  4:24               ` Bart Schaefer

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=140603234229.ZM29030@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@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).