zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: "Mark J. Reed" <markjreed@gmail.com>, zsh-workers@zsh.org
Subject: Re: [BUG] multibyte never set according to setopt/unsetopt output
Date: Wed, 20 Dec 2023 17:59:28 +0100	[thread overview]
Message-ID: <CAHYJk3TG6ft4J=0ep+7aXM-c8UFBGvv8aN=1FMnk2sNNGM4vKg@mail.gmail.com> (raw)
In-Reply-To: <1743596511.1328269.1703089342052@mail.virginmedia.com>

On 12/20/23, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
>> On 20/12/2023 16:04 GMT Mark J. Reed <markjreed@gmail.com> wrote:
>>
>>
>> 5.9, running on macOS. zsh fires up with multibyte enabled by default,
>> which is visible in the way it handles multibyte characters (e.g. x=ā;
>> echo $#xshows 1). I can turn the option off, and the behavior changes
>> (e.g. the same parameter has a length of 2).
>>
>> But `unsetopt` always shows `nomultibyte`, and `setopt` never shows
>> `multibyte`, regardless of the actual setting.
>
> You've fallen foul of the slightly odd way that options are shown by
> default.
>
> The key phrase in the manual for setopt is "minimize the differences from
> the default options".  Since multibyte is on by default, it's not a
> difference.
>
> You should find if you unset it, however, that it shows up in setopt
> as "nomultibyte".  If it didn't (it does for me but I'm on a recent
> unreleased version) that would indeed be a bug.

To add to this, another quirk is that "unsetopt" does not do 'the same
as setopt but for unset options', but rather it shows all currently
unset options (with their set names, confusingly), while as Peter
mentioned, setopt shows the option set differing from the default (of
the current emulation?) and not inverted like unsetopt does. The
consequence of this is that (since multibyte is on by default), one of
setopt and unsetopt will always show "nomultibyte" in its output :).
(setopt says nomultibyte is set, unsetopt says nomultibyte is unset
(eg multibyte is set)).

-- 
Mikael Magnusson


      parent reply	other threads:[~2023-12-20 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20 16:04 Mark J. Reed
2023-12-20 16:22 ` Peter Stephenson
2023-12-20 16:44   ` Bart Schaefer
2023-12-20 16:54     ` Mikael Magnusson
2023-12-20 16:55     ` Peter Stephenson
2023-12-20 17:06       ` Mikael Magnusson
2023-12-20 17:30         ` Peter Stephenson
2023-12-20 17:40           ` Mikael Magnusson
2024-01-19 15:02             ` Mark J. Reed
2024-01-20 22:27               ` Bart Schaefer
2023-12-20 16:59   ` Mikael Magnusson [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='CAHYJk3TG6ft4J=0ep+7aXM-c8UFBGvv8aN=1FMnk2sNNGM4vKg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=markjreed@gmail.com \
    --cc=p.w.stephenson@ntlworld.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).