zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history
Date: Mon, 18 Dec 2023 04:37:52 +0100	[thread overview]
Message-ID: <20231218033752.GB3237@zira.vinc17.org> (raw)
In-Reply-To: <CAH+w=7bLFPJX+sX+P2uzWferX2EhZxxcVqe94w2_Bz25dOrKvQ@mail.gmail.com>

On 2023-12-17 11:37:12 -0800, Bart Schaefer wrote:
> This is another reason 'a' doesn't throw away the history -- you could
> lose many lines of typing above the point of canceling the correction.

There could have been a special history file for aborts. Or perhaps
the history file could have some flag for commands that are in the
history but have never been run.

Note that in many cases when I want to abort is when the command
already comes from the history. So there's no point saving it again
in general.

> > > > Or just use 'e', then immediately put the command in the history
> > > > without running it. Is there a zle widget for that? I would find
> > > > this useful even when there are no spelling corrections.
> > >
> > > Correction is not itself a ZLE action -- it happens after ZLE has
> > > returned control to the parser, and works even if ZLE is disabled.
> > > So there's no widget to fiddle with it.
> >
> > But what matters is that after 'e', one is in ZLE.
[corrected a typo]

> You asked if there was a widget to immediately put the command in the
> history after 'e'.  There's not a widget to do all of that, because
> there's not a widget triggered on 'e'.

What I intended to mean was just a widget that puts a command in the
history without running it. This is unrelated to corrections (see the
"I would find this useful even when there are no spelling corrections"
sentence above). The point would just be to save what has been typed
and recall this later.

In general, when I type 'e', I just want to edit the command.

> That said ... attached is an actual ZLE implementation of correctall.

I would be much more interested in a "correctnone": there are some
cases where one knows that there is nothing to correct, e.g. because
the arguments do not correspond to existing filenames (they could be
the result of all-matches, for instance).

-- 
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:[~2023-12-18 20:36 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 [this message]
2023-12-18  6:36                 ` Bart Schaefer
2024-01-21  5:06     ` Bart Schaefer

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=20231218033752.GB3237@zira.vinc17.org \
    --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).