I have my '[' key bound to `insert-parentheses' so that any open-paren I type gets a symmetric closing paren inserted. Consider what happens now when I type, say,
[ user-home TAB
Just before hitting tab, the buffer contains the following text, with extra spaces inserted to show the point's location:
( u s e r - h o m e ) | point
Hitting tab completes the symbol, but decides, since this looks like a function call position and there are no arguments for this function, to insert a closing paren:
(user-homedir-pathname))
Now I have an extra closing paren hanging out there.
That's `slime-complete-symbol*-fancy-bit' doing its job. A corrective patch is simple:
However, this may not play nicely for those who do not use `insert-parentheses' in a situation such as this:
Existing code:
(foo 1 2)
Decide to add a third argument (spaced out again):
( f o o 1 2 ( b a ) | point
Hit tab at the indicated point position and wind up with:
(foo 1 2 (bar)
Now the originally balanced parens are not balanced, because my patch disabled the auto-insert-paren behavior.
Is there a way to satisfy both use cases without adding another configuration variable?
"Steven E. Harris" seh@panix.com writes:
I have my '[' key bound to `insert-parentheses' so that any open-paren I type gets a symmetric closing paren inserted. Consider what happens now when I type, say,
[ user-home TAB
I turned the slime-complete-symbol*-fancy off by default. To turn it back on just use e.g. `M-x customize-group slime-mode'.
I find it trips me up too much and there's no obvious Right way for it to work. Another example is functions where the arguments are optional: should a closing paren be inserted? Since I type a lot faster than I think the unpredictability slows me down a bit.
Is there a way to satisfy both use cases without adding another configuration variable?
Open question!
Luke Gorrie luke@synap.se writes:
"Steven E. Harris" seh@panix.com writes:
I have my '[' key bound to `insert-parentheses' so that any open-paren I type gets a symmetric closing paren inserted. Consider what happens now when I type, say,
[ user-home TAB
I turned the slime-complete-symbol*-fancy off by default. To turn it back on just use e.g. `M-x customize-group slime-mode'.
.. now I really have.
Funny, I was having trouble accessing CVS but didn't know why. Turns out my hotel internet access has expired, but my existing connections are left online. Very generous of them to offer this unlimited service to users of ssh port forwarding.