Karim BELABAS on Wed, 27 Nov 2002 10:33:40 +0100 (MET)

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

Re: [PATCH CVS] Readline improvements

On Tue, 26 Nov 2002, Ilya Zakharevich wrote:
> On Tue, Nov 26, 2002 at 06:41:56PM +0100, Karim BELABAS wrote:
>>>   a) Restores the historic behaviour of TAB (insert the template for
>>>      function arguments), if one wants help, press F1 or M-h;
>> I had removed it after receiving some complaints:
>> 1) it is all too common to hit TAB once to many and get arguments inserted
>> without wanting it.
> ??? Just do what you do with any other key: press Alt-Backspace.

Alt-Backspace = backward-delete-word is it not ?

Then you need to type it, e.g. 4 times after bnfinit(<TAB>)

> > 2) with default keymaps and common keyboard layouts, undoing is awkward
> > ( Control + Shift + - ). The people who complained did not even know undoing
> > was possible (and they erased templates character by character).
> So fix the default keymap; what is the problem?

That it is a not-so-user-friendly default behaviour.

> Anyway, with the new default(readline) it is easy to make this behaviour
> conditional...

IMHO, that's the best solution. Default being off.

> > 3) what is the purpose of inserting templates, when actual parameters will
> > have in 99.99% of cases a different name ?
> I find it indispensable to have the info about the order of arguments
> without a need to look at a different part of the screen.

OK. With <F1>/<M-h> it appears a few lines above due to the help text. Then,
why not print the (1-line) prototype in the message zone ?

> I'm waiting for my patches to be included to insert the next batch of
> readline improvements; including sane bindings for all the normal keys
> (End, Prior, Meta-Left, Control-Right etc).

I've included your readline patches (the two of them).

> BTW, anybody having a snippet of code how not to overwrite keys in
> .inputrc?

Easiest solution I can think of is: bind everything then reload .intputrc
( rl_read_init_file(NULL) )

> > >   b) make default(readline,4) and default(readline,2) etc. switch the
> > >      electric TAB (as above) and electric-parens settings;
> >
> > Hum. The idea was that all readline-specific settings go to .inputrc
> This "idea" is absolutely broken.  I see no reason why we should
> support a broken API when we have something much better...

Again, I'm open to your solution (would not have included the patch
otherwise:-). Can you document your new readline default ?

>>>   e) Beginning of support for Mouse-Editing in xterm (see
>>> http://groups.google.com/groups?selm=ani7hg%24bmf%241%40agate.berkeley.edu&output=gplain).
>> I do not understand how this is used. I just downloaded Dickey's xterm-170,
>> compiled with the -DOPT_READLINE flag, but nothing happens when I click
>> around.
> To have *full* support, a little bit of tweaking for xterm and GP is
> needed.  But to have 95% of it, just emit the sequences mentioned in
> my post (e.g., before starting gp):
>   \e[?2001;2002;2003;2004;2005;2006s^[[?2001;2002;2003;2004;2005h

OK, now it works. Very nice !

> `s' stores the old setting, `h' enables, `r' restores the old setting.
> I do not remember whether 2006 is needed with GNU readline - but
> anyway, we do not have a full support of readline input with embedded
> newlines now.  [*]
> [*] How to treat it?  Is it sane to implicitly inclose it in {} ?

It sounds sane to me.

> [I got this idea when observing Don Zagier using both keyboard and
> mouse in one of sun tools (do not remember which)

commandtools (mostly incompatible with readline, sad.)


Karim Belabas                    Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425  Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud             Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France)           http://www.math.u-psud.fr/~belabas/
PARI/GP Home Page: http://www.parigp-home.de/