Search code examples
emacsparedit

Prevent paredit from inserting a space when inserting parentheses - and other issues


I love paredit. But there are a couple of things I hate, and have not yet come around to fixing them:

  • Opening a parenthesis inserts a space before the parenthesis. I understand this is probably the preferred style of the whole internet, but it is not mine. How can avoid this?
  • When inside a quoted area (''), I am not able to back-delete. Also, typing a double quote (") will insert a backslash (obviously to escape the double quote - only that this is not needed, at least in python. So I do not want the backslash. How to configure this?
  • Actually, paredit tries (and fails) to be very wise relating backspace. My backspace should always delete the previous character, no matter whether I am in an unfinished quoting area (paredit just refuses to do anything if the quotes do not match. Try to delete here: "helloo). The only situation where a delete makes sense to be treated specially is when the point is just before an opening parenthesis.

Solution

  • This is not an answer, but too long for a comment...

    Paredit is intended for languages where not having a space before a ( would be horrible, and ones that do not have python's "quote-cleverness". You could probably hack it for these issues, but the syntax of python is sufficiently different that making it work there would be a non-trivial project.

    As for your last point, that sounds like you don't want paredit at all, since it's very intentionally trying to keep your parens & quotations balanced, so maybe it's not the right tool for you. IOW, you might prefer auto pairs or electric pair or a bunch of other similar tools.