zsh-workers
 help / color / mirror / code / Atom feed
From: Jim <linux.tech.guy@gmail.com>
To: devs <zsh-workers@zsh.org>
Subject: Clarifying man page(s)
Date: Sun, 13 Mar 2022 10:14:33 -0500	[thread overview]
Message-ID: <CA+rB6GLYvbaNXiH7wFkbCN5xrV+GFBLCxdtt5Z5v74JOw=f5Gg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

While working on a script I encountered an issue with setopt.  Since I was
setting and
unsetting an option multiple times I placed both in a functions to mostly
get rid of the
extra typing. But as some may already guessed, that didn't work.

So looked at man zshall. Nothing jumped out. Google here I come. Eventually
found
<https://unix.stackexchange.com/questions/468693/zsh-put-all-non-global-parameters-to-anonymous-local-inner-function>
this
<https://unix.stackexchange.com/questions/468693/zsh-put-all-non-global-parameters-to-anonymous-local-inner-function>
where Stéphane Chazelas wrote:
(note that zsh only implements local scope for variables and options, not
for functions, aliases...)

This eventually got me to "emulate -L zsh" which is what I had at the top
of my script. That led
to "local_options". Found what caused the issue.

To the point/question:  Should zshoptions man page have a clear statement
at the very
beginning that "options" can have a local "scope"?  "Scope" is only
mentioned later in in
three options. This on my part is assuming "scope" is the correct word to
use here.

FWIW, the "emulate builtin" references the three options (local_optioon,
local_patterns and
local_traps) but only two backreference emulate, local_traps does not.

Thanks for listening.

Jim Murphy

Working with Unix/Linux for 40 years, so man pages have a love/hate
relationship for me.
Never clear enough or enough GOOD examples in them. That said the zsh man
pages
are good, but not perfect or as clear as they could be in all cases. Thanks
to all who have
made them as good as they are.

[-- Attachment #2: Type: text/html, Size: 2061 bytes --]

             reply	other threads:[~2022-03-13 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 15:14 Jim [this message]
2022-03-14 10:58 ` Peter Stephenson

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='CA+rB6GLYvbaNXiH7wFkbCN5xrV+GFBLCxdtt5Z5v74JOw=f5Gg@mail.gmail.com' \
    --to=linux.tech.guy@gmail.com \
    --cc=linuxtechguy@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).