[Top][All Lists]

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

[Bug-readline] Re: Using SIGINT/rl_free_line_state () in .inputrc?

From: Tim Landscheidt
Subject: [Bug-readline] Re: Using SIGINT/rl_free_line_state () in .inputrc?
Date: Sun, 28 Mar 2010 23:55:57 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Chet Ramey <address@hidden> wrote:

>>>> (The "\\r\n" tells psql to clear its query buffer.) Unfortu-
>>>> nately, this doesn't work if readline is in "quote mode",
>>>> e. g. the preceding line contains an opening "'" or '"'. I
>>>> noticed though that pressing C-c does what I want: It can-
>>>> cels all active thingies and gives me a clean prompt.

>>>>   Unfortunately, I can't use "\C-c" to invoke it as the key
>>>> probably gets passed as SIGINT to readline. Is there another
>>>> way to "call" rl_free_line_state () from a binding defini-
>>>> tion?

>>> Why not bind a key sequence to "abort" and use it in the macro?

> I'm sorry, I didn't read this closely enough.  You're not going to be able
> to do this well without application support.  Readline doesn't have a
> notion of a "quote mode," for instance -- it works a line at a time.  An
> application can note that a line contains an unbalanced quote and
> accumulate subsequent lines into a complete command, but readline
> doesn't know about this.

> I suspect that psql works much like bash in this regard.  The disconnect
> between separate lines of input is why readline has a hard time honoring
> quoting that appears on a previous line while doing completion in bash.
> [...]

Okay, thanks for clearing that up. I guess I'll stay with my
"\C-a\C-k\\r\n" solution then as it works "well enough" and
patching psql would require a lot of effort for little gain.


reply via email to

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