zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: nocorrect documentation and behavior
Date: Wed, 13 Mar 2024 17:17:32 +0100	[thread overview]
Message-ID: <20240313161732.GA3513530@cventin.lip.ens-lyon.fr> (raw)

With zsh 5.9, consider:

cventin% setopt CORRECT_ALL
cventin% zsha && zshb && nocorrect zshc && zshd
zsh: correct 'zsha' to 'zsh' [nyae]? n
zsh: correct 'zshb' to 'zsh' [nyae]? n
zsh: command not found: zsha

while without "nocorrect", the 4 commands are proposed for correction.

The following lines are handled in the same way:

  zsha ; zshb ; nocorrect zshc ; zshd
  zsha ; zshb ; echo $(nocorrect zshc) ; zshd

"nocorrect" is documented under "PRECOMMAND MODIFIERS". So it is
surprising that it can affect more than the corresponding command.

Is this the expected behavior?

Well, at least this is useful to be able to use "nocorrect" on
the "for" words:

  nocorrect : ; for i in word1 word2 ; do echo $i ; done

Given the context "PRECOMMAND MODIFIERS", the documentation is not
explicit:

    nocorrect
        Spelling correction is not done on any of the words. This
        must appear before any other precommand modifier, as it is
        interpreted immediately, before any parsing is done. It has
        no effect in non-interactive shells.

If this is the expected behavior, I suppose that the documentation
should be something like

  Spelling correction is not done on any of the subsequent words
  of the full command line. [...]

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


             reply	other threads:[~2024-03-13 16:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 16:17 Vincent Lefevre [this message]
2024-03-14  3:46 ` Bart Schaefer
2024-03-15 11:55   ` Vincent Lefevre

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=20240313161732.GA3513530@cventin.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --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).