bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] add operate-and-get next (C-o) from Bash


From: Greg Price
Subject: [PATCH] add operate-and-get next (C-o) from Bash
Date: Fri, 24 Apr 2020 22:12:06 -0700

This isn't a bug, but it's a feature I'd love to have: the
operate-and-get-next function (C-o) of Bash, which I'd find extremely
handy to use in some other Readline-equipped programs, too.

Unlike most of the Readline functions provided specifically by Bash,
this one doesn't involve globbing or shell expansions or anything
else Bash- or shell-specific; it really is all about just entering
lines and retrieving them from a history.  The use case for it is
basically any kind of command-line interface where you might want to
repeat, or repeat with editing, several consecutive commands in
sequence -- which I think in my experience has described just about
every CLI program I've used.  For those reasons I think the feature
is a good fit to be provided by Readline itself.

So, here's a patch that largely copies into Readline the implementation
from Bash, including the bugfix that entered the devel branch this
week.  Some names are changed to fit being part of Readline, and the
documentation (the Texinfo source, anyway) is updated.

I tested the patch in rltest (from examples/), and it worked great there.

I've also included a version of the patch that's against the Bash
tree.  The changes in lib/readline/ are identical to the other patch,
and then it just deletes the implementation in bashline.c.  In a quick
test the feature's behavior in Bash was unchanged, as expected.

Thanks, best regards,
Greg

Attachment: readline-operate-and-get-next.patch
Description: Text Data

Attachment: bash-readline-operate-and-get-next.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]