zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: setopt
Date: Sun, 30 Nov 2014 19:31:47 -0800	[thread overview]
Message-ID: <141130193147.ZM29029@torch.brasslantern.com> (raw)
In-Reply-To: <547B79A6.1030003@eastlink.ca>

On Nov 30, 12:10pm, Ray Andrews wrote:
}
} I discover 'setopt -ksh_option_print', which makes " $ setopt " (by
} itself) actually useful. Shouldn't that be the default?

It is the way it is because of preserving historic behavior.  Back in
1995 or so there was briefly a push to turn zsh into a ksh clone.  As
part of that effort the collection of setopt strings was "sanitized"
so that (except for "nomatch") they all have positive sense, so that
attaching a "no" prefix is the same as using "unsetopt".  (This was
also when "junkie" got stuck into the names of some csh compatibility
options, a tidbit which annoys me to this day.)

The problem with this change was that it caused a whole lot of options
to begin reporting themselves in the "wrong" sense, creating confusion
for both new and longtime users.  The compromise that was reached was
to have "setopt" by default display only the options that differed from
their default settings.

} Wouldn't we almost always want to see what the options are set to?

Who is this "we" of whom you speak?

If there were a lot fewer than 175 options, then possibly yes, but
defaulting to dumping that much information is just overwhelming; you
can't even begin to handle it without piping it to a pager.

} And if not, can't we have " $ setopt -v " to achieve the same thing?

"set -o" will do what you want -- but note that comes from /bin/sh where
there maybe a dozen possible options to report.  Even bash has only a
bit over two dozen.

"setopt -v" sets the VERBOSE option, and though there is some precedent
for mucking with that (i.e., "setopt -m" does *not* set MONITOR) there
would need to be a better reason to replace -v.

On the other hand "setopt -o" just throws an error if not followed by
an option name, so we could consider redefining *that* like "set -o".

Aside:  Does anybody have a sensible use case for the pattern-matching
behavior of "setopt -m"?  "setopt -m posix\*" maybe?


  reply	other threads:[~2014-12-01  3:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30 20:10 setopt Ray Andrews
2014-12-01  3:31 ` Bart Schaefer [this message]
2014-12-01  4:34   ` setopt Ray Andrews

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=141130193147.ZM29029@torch.brasslantern.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).