zsh-workers
 help / color / mirror / code / Atom feed
* nocorrect documentation and behavior
@ 2024-03-13 16:17 Vincent Lefevre
  2024-03-14  3:46 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Lefevre @ 2024-03-13 16:17 UTC (permalink / raw)
  To: zsh-workers

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-15 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 16:17 nocorrect documentation and behavior Vincent Lefevre
2024-03-14  3:46 ` Bart Schaefer
2024-03-15 11:55   ` Vincent Lefevre

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).