From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history
Date: Sat, 20 Jan 2024 21:06:45 -0800 [thread overview]
Message-ID: <CAH+w=7aiFkVZy7a50V5rsqCM1yyVpms9VoK0iZBzUwbqNF2Ucg@mail.gmail.com> (raw)
In-Reply-To: <20231205125732.GA1126552@cventin.lip.ens-lyon.fr>
[-- Attachment #1: Type: text/plain, Size: 886 bytes --]
Coming back to this because of the unfinished documentation patch.
On Tue, Dec 5, 2023 at 4:57 AM Vincent Lefevre <vincent@vinc17.net> wrote:
>
> I was also thinking about the SPROMPT documentation. The following
> is inexact:
>
> n (`no') (default)
> Discard the correction and run the command.
> y (`yes')
> Make the correction and run the command.
After thinking about this for bit, I realized that the foregoing was
written specifically for the CORRECT option and was never made to
reflect CORRECT_ALL.
> One may think that the command will be run immediately after 'n' or 'y'
> (i.e. not checking for other corrections).
That's exactly what does happen with CORRECT. So this --
> Discard/Make the correction and prompt for the next correction
> or run the command.
-- isn't right either, unless CORRECT_ALL is set.
[-- Attachment #2: sprompt-correctall.txt --]
[-- Type: text/plain, Size: 1048 bytes --]
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 68df4a16f..a6fbe6723 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1635,9 +1635,13 @@ All other prompt escapes are also allowed.
The actions available at the prompt are tt([nyae]):
startsitem()
-sitem(tt(n) +LPAR()`no'+RPAR() +LPAR()default+RPAR())(Discard the correction and run the command.)
-sitem(tt(y) +LPAR()`yes'+RPAR())(Make the correction and run the command.)
-sitem(tt(a) +LPAR()`abort'+RPAR())(Discard the entire command line without running it.)
+sitem(tt(n) +LPAR()`no'+RPAR() +LPAR()default+RPAR())(Discard the correction.
+If there are no more corrections, accept the command line, else (with
+tt(CORRECT_ALL)) prompt for the next.)
+sitem(tt(y) +LPAR()`yes'+RPAR())(Make the correction. If there are no more
+corrections, accept the command line.)
+sitem(tt(a) +LPAR()`abort'+RPAR())(Place the entire command line in the
+history for later edit, but without accepting it.)
sitem(tt(e) +LPAR()`edit'+RPAR())(Resume editing the command line.)
endsitem()
)
prev parent reply other threads:[~2024-01-21 5:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 2:12 Vincent Lefevre
2023-12-05 4:10 ` Bart Schaefer
2023-12-05 12:57 ` Vincent Lefevre
2023-12-05 21:22 ` Bart Schaefer
2023-12-06 15:03 ` Vincent Lefevre
2023-12-09 21:44 ` Bart Schaefer
2023-12-17 13:54 ` Vincent Lefevre
2023-12-17 19:37 ` Bart Schaefer
2023-12-18 3:37 ` Vincent Lefevre
2023-12-18 6:36 ` Bart Schaefer
2024-01-21 5:06 ` Bart Schaefer [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='CAH+w=7aiFkVZy7a50V5rsqCM1yyVpms9VoK0iZBzUwbqNF2Ucg@mail.gmail.com' \
--to=schaefer@brasslantern.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).