Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope)
- X-seq: zsh-workers 47922
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Devin Hussey <husseydevin@xxxxxxxxx>
- Subject: Re: NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope)
- Date: Sat, 6 Feb 2021 12:31:32 +0000
- Archived-at: <https://zsh.org/workers/47922>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/20210206123132.GB18168%40tarpaulin.shahaf.local2>
- In-reply-to: <CAH+w=7aGwVpS-r_OCoMWu04J54VLq1XOEfvf6J50osZsiQw_KA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAEtFKssJf-cN_EM+=5_10seY58jqALV-YH8+z5+Lm-04v493Nw@mail.gmail.com> <CAH+w=7bn8JYPx29LPGnT4ughEt-z+-rUokUz739foP=JCY9B7g@mail.gmail.com> <CAEtFKssJVz9mr3vA_vY77m2bsrXWBKHz1qgv83jzeY0jLXzPjQ@mail.gmail.com> <CAH+w=7aoaGhVCqZQ6K+z0HqJg3agOav6bh6M_9pg464aAC+htQ@mail.gmail.com> <CAH+w=7Y5UQDd7Xn6g9MR_oYtDFw8S-2WpX7xEehPZ9y47=ex8w@mail.gmail.com> <CAH+w=7aLB+wHaZe=dedrmdVxvqQjMMk4vFz99rKCAadtNzgbqw@mail.gmail.com> <1009925809.3264416.1611583549597@mail2.virginmedia.com> <CAH+w=7aGwVpS-r_OCoMWu04J54VLq1XOEfvf6J50osZsiQw_KA@mail.gmail.com>
Bart Schaefer wrote on Thu, Feb 04, 2021 at 21:53:12 -0800:
> It's actually the documentation that gets more complicated, the code
> is pretty simple. I rewrote the paragraph I've added to options.yo
> about seven times and I'm still not entirely happy with it.
Took a stab at it, below.
> What I elected was to keep the current behavior by default, and add an
> option to get the behavior that termux wants. I named it CASE_PATHS
> for reasons I think the documentation paragraph make obvious.
Hmm. It may be a bikeshed, but might people guess an option named
CASE_PATHS has to do with $PATH?
> +++ b/Doc/Zsh/options.yo
> @@ -474,6 +474,22 @@ item(tt(CASE_MATCH) <D>)(
> +pindex(CASE_PATHS)
> +pindex(NO_CASE_PATHS)
> +pindex(CASEPATHS)
> +pindex(NOCASEPATHS)
> +cindex(case-sensitive globbing, option)
> +item(tt(CASE_PATHS))(
> +If tt(CASE_PATHS) is not set (the default), tt(CASE_GLOB) affects the
> +interpretation of em(every) path component, whenever a special
> +character appears in em(any) component. When tt(CASE_PATHS) is set,
> +file path components that do em(not) contain special filename
> +generation characters are always sensitive to case, thus restricting
> +tt(NO_CASE_GLOB) to components that contain globbing characters.
> +
> +Note that if the filesystem itself is not sensitive to case, then
> +tt(CASE_PATHS) has no effect.
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index b3bf11f5c..4aca04746 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -463,6 +463,12 @@ the presence of any character which is special to filename generation
will cause case-insensitive matching. For example, tt(cvs+LPAR()/+RPAR())
can match the directory tt(CVS) owing to the presence of the globbing flag
(unless the option tt(BARE_GLOB_QUAL) is unset).
+
+The case-insensitive matching is affected by the tt(CASE_PATHS) option,
+which see.
+
+Note that if the filesystem itself is not sensitive to case, then
+this option has no effect.
)
pindex(CASE_MATCH)
pindex(NO_CASE_MATCH)
@@ -474,6 +480,23 @@ item(tt(CASE_MATCH) <D>)(
Make regular expressions using the tt(zsh/regex) module (including
matches with tt(=~)) sensitive to case.
)
+pindex(CASE_PATHS)
+pindex(NO_CASE_PATHS)
+pindex(CASEPATHS)
+pindex(NOCASEPATHS)
+cindex(case-sensitive globbing, option)
+item(tt(CASE_PATHS))(
+This option only has an effect when the tt(CASE_GLOB) option is unset, which is
+not the default.
+
+This option governs the case-insensitive matching used when the tt(CASE_GLOB)
+option is unset. When this option is unset (the default), whenever a special
+character appears in em(any) path component, em(all) components will be
+interpreted case-insensitively. When this option is set,
+file path components that do em(not) contain special filename
+generation characters are always sensitive to case, thus restricting
+tt(NO_CASE_GLOB) to components that contain globbing characters.
+)
pindex(CSH_NULL_GLOB)
pindex(NO_CSH_NULL_GLOB)
pindex(CSHNULLGLOB)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author