zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users List <zsh-users@zsh.org>
Subject: Re: modifiers applied after e qualifier but before oe?
Date: Mon, 2 Aug 2021 14:19:25 -0700	[thread overview]
Message-ID: <CAH+w=7b_Q84me8WNg8QQz_q3EKB_4p2zUKcJWqDtt9_vaqeNAw@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Y0X7QiRaBymb26cH_vrh94j5LjeazmeEhfFQny-KthKQ@mail.gmail.com>

On Mon, Aug 2, 2021 at 9:27 AM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> It's probably intended so that the result of ordering is on the
> modified result rather than on the original path.  I do find it
> surprising that it's not mentioned anywhere, though.

I wonder if we need a section on the order of events for globbing,
akin to the "Rules" section for parameter expansion.

What's going on here is that all of the orderings to be applied to a
given filename generation (glob) are collected as the expression is
parsed, and then applied at the very end after everything else has
modified the result.  This is why the doc notes that you can't have
more than 12 sort operations on any glob, and it confirms that you
can't change what's seen as the incoming value of $REPLY by the 'oe'
code block.

However, if for some reason you need to do this all in the glob, you
could use the first 'e' block to stash a mapping (in a global hash,
say) and then look up that mapping in the 'oe' block to set $REPLY for
the sort.  That means moving the qualifiers into the 'e' block to
assign to $reply, but it's all in one glob.


      reply	other threads:[~2021-08-02 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 14:42 Stephane Chazelas
2021-08-02 16:27 ` Bart Schaefer
2021-08-02 21:19   ` Bart Schaefer [this message]

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=7b_Q84me8WNg8QQz_q3EKB_4p2zUKcJWqDtt9_vaqeNAw@mail.gmail.com' \
    --to=schaefer@brasslantern.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).