Karim BELABAS on Mon, 27 Apr 1998 18:20:40 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Ilya's readline patches. |
> [me:] > > They are certainly useful and I myself will use them, but electric > > parentheses can be rather annoying and it's not too easy to guess how to > > toggle them out (it's obvious from the code, but...). So I'd like to switch > > them off by default. The problem is that I see only one way to toggle them > > from readline's .inputrc: unbind the hot keys, and let the user bind them > > in his .inputrc. Specifically: > > > > $if Pari-GP > > (: pari-matched-insert > > [: pari-matched-insert > > $endif [Gerhard:] > As was discussed a while ago in email, if `(' and `[' are electric, > pasting something containing them into the input line will have rather > undesirable effects. > > One could construct Yet Another Pari-specific Readline Function to > toggle the behaviour, or one to turn it off and another to turn it on, > and bind that/those to some readline key combination/s. No need. Giving a 0 argument to pari-matched-insert will toggle electric insertion off (a negative argument will toggle it back). So M-0 ( and M-- ( will do if ( is bound as above. > However, with `(' and `[' bound to self-insert by default, and without > requiring even pari-matched-insert, The User could bind (and I have > bound) the keyseq macros > > $if Pari-GP > Meta-(: "()\C-b" > Meta-[: "[]\C-b" > $endif > (So, what disadvantages of _this_ approach have I overlooked?) That I'm used to electric parentheses when typing ordinary C code / GP scripts (and to toggling paste mode in and out), and I'd hate to type Alt-Shift-9 instead... In any case your solution amounts to unbind pari-matched-insert and let the user bind whatever he feels most comfortable with. So I guess you support my proposal... Karim. -- Karim Belabas e-mail: belabas@math.u-psud.fr Dep. de Mathematiques, Bat. 425 Universite Paris-Sud Tel: (33 1) 01 69 15 57 48 F-91405 ORSAY Fax: (33 1) 01 69 15 60 19