Gerhard Niklasch on Mon, 27 Apr 1998 17:51:01 +0200

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

Re: Ilya's readline patches.

> Date: 	Mon, 27 Apr 1998 17:32:24 +0200
> From: Karim BELABAS <>
> Message-Id: <>
> 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

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.

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"

in .inputrc to turn M-(,M-[ into electric opening parentheses/brackets
which are immune to pasting effects.  This in fact is also the default
binding in a number of Emacs modes.  (So, what disadvantages of _this_
approach have I overlooked?)

Enjoy, Gerhard