zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Cc: Devin Hussey <husseydevin@gmail.com>
Subject: Re: NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope)
Date: Sat, 6 Feb 2021 12:31:32 +0000	[thread overview]
Message-ID: <20210206123132.GB18168@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <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)


  reply	other threads:[~2021-02-06 12:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  3:04 [PATCH] Allow globbing with unreadable parent directories Devin Hussey
2021-01-13 22:27 ` Bart Schaefer
2021-01-14  0:27   ` Devin Hussey
2021-01-14  1:32     ` Lawrence Velázquez
2021-01-14  2:22       ` Devin Hussey
2021-01-14  2:24         ` Devin Hussey
2021-01-17 17:22       ` Daniel Shahaf
2021-01-17 18:02         ` Bart Schaefer
2021-01-17 18:23           ` Bart Schaefer
2021-01-14  4:04     ` Bart Schaefer
2021-01-14  5:57       ` NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope) Bart Schaefer
2021-01-14 18:56         ` Bart Schaefer
2021-01-25  0:52         ` Bart Schaefer
2021-01-25 14:05           ` Peter Stephenson
2021-02-05  5:53             ` Bart Schaefer
2021-02-06 12:31               ` Daniel Shahaf [this message]
2021-03-27 17:31           ` Lawrence Velázquez
2021-04-10 20:56             ` Lawrence Velázquez
2021-04-10 21:22               ` Bart Schaefer
2021-04-13 11:46                 ` Daniel Shahaf
2021-04-13 21:33                   ` 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=20210206123132.GB18168@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=husseydevin@gmail.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).