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?