When using paredit in programming modes such as C, typing ( will insert a space before the paren when I’m trying to call a function, leaving me with:
foo ()
Is there a way to disable the insertion of the space without changing paredit’s source?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, the way paredit appears to work is that it checks the syntax tables to see if you’re inserting a pair right after a word/symbol/etc., in which case it forces a space to be inserted. You need to override that functionality – which can be done a number of different ways: advice, redefine the function determining space, changing the syntax table, etc.
I’d try the straight forward:
This will obviously apply to all places where you use
paredit. If you want something more mode specific, you can add some conditions to thatandstatement (e.g.(and ... (memq major-mode '(c-mode lisp-mode)))).So… I guess I did change the “source”, but you can do the same thing with a piece of
defadvice… it’s all elisp, so the difference is minimal. There doesn’t appear to be a setting to control this type of behavior.