Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Skip Montanaro writes: > On Tue, Aug 19, 2014 at 3:44 AM, Lele Gaifax wrote: >> Given these lines in the history: >> >> >>> a=10 >> >>> a-=1 >> >>> print(a) >> 9 > > Suppose you have the above, as you indicated. Ctl-P your way back to > the a=10 line. Press Ctl-O. It executes tha

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Skip Montanaro
On Tue, Aug 19, 2014 at 3:44 AM, Lele Gaifax wrote: >> Does your position in the history disappear if you >> operate_and_get_next(), then modify the next recalled input line? > > Not sure what you mean with "disappear": basically o-a-g-n "accepts" the > current line (that is, "executes" it, and th

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Lele Gaifax writes: > Chris Angelico writes: > >> On Tue, Aug 19, 2014 at 10:17 AM, Steven D'Aprano >> wrote: >> >>> Can you create a feature request for it on the bug tracker, mark me >>> (steven.daprano) as interested, and upload your diff? >> >> And please mark me (rosuav) as interested ("no

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Chris Angelico writes: > On Tue, Aug 19, 2014 at 10:17 AM, Steven D'Aprano > wrote: > >> Can you create a feature request for it on the bug tracker, mark me >> (steven.daprano) as interested, and upload your diff? > > And please mark me (rosuav) as interested ("nosy"), too Sure, will do that AS

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Skip Montanaro writes: > Looks reasonable to me, at least if I understand the intent correctly. > I've never used this functionality in bash (wasn't aware it existed). > I assume the intention here is to easily re-execute compound > statements pulled from saved history. Yes, or any arbitrary seq

Re: Adapt bash readline operate-and-get-next

2014-08-18 Thread Chris Angelico
On Tue, Aug 19, 2014 at 10:17 AM, Steven D'Aprano wrote: > I would love to see support for this in Python. Unfortunately, I'm not > qualified to review your code. Can you create a feature request for it on > the bug tracker, mark me (steven.daprano) as interested, and upload your > diff? If the pa

Re: Adapt bash readline operate-and-get-next

2014-08-18 Thread Steven D'Aprano
Lele Gaifax wrote: > This is just a first attempt to adapt the Bash code to the Python > readline.c module: I'm very surprised that the half-an-hour I spent on > it, mostly to locate related code, actually full filled the goal :-) You're my hero!!! [...] > Even if I know this is not the right fo

Re: Adapt bash readline operate-and-get-next

2014-08-18 Thread Skip Montanaro
On Mon, Aug 18, 2014 at 1:49 PM, Lele Gaifax wrote: > Even if I know this is not the right forum and I should (and I > eventually do, assuming a positive feedback) instead open a ticket and > attach the patch there, I'd like to hear opinions on whether this should > be enabled by default, and poss

Adapt bash readline operate-and-get-next

2014-08-18 Thread Lele Gaifax
Steven D'Aprano writes: > On Mon, 21 Jul 2014 17:57:22 +0200, Lele Gaifax wrote: >> Granted, the readline library exposes a "operate-and-get-next" function, >> by default bound to \C-o... > > Have you actually got that working in Python with the readline module? > I've tried and tried and cannot