1

I started to write some elisp and have am having trouble with the brackets/parentheses. Often, I delete only one bracket/parenthesis and left the other dangling. I have trouble finding the matches.

How do I manage brackets/parentheses to keep them balanced?

0

2 Answers 2

2

paredit-mode is very popular. There are a few others; the key thing to search for is “structural editing”.

3

Before you start looking for extensions, you should read the documentation about what Emacs provides natively. In particular, parenthesis matching and editing is something you can read about in the manual: C-h i g(emacs)parentheses will take you to a section that describes commands that deal with moving past a "balanced expression" in various directions, commands that allow you to move "up, down and across in the structure of parentheses" and commands that allow you to see matching parentheses.

After that, as @db48x's answer points out,paredit-mode is one direction that you could go, but there are others as well. The EmacsWiki is a useful source of information on this and many other topics. Searching for parentheses on the main page brings you to a page with lots of information on the topic (including paredit BTW).

In summary, learning enough about Info so you can easily find things in the manuals is going to repay you a thousand-fold in the future. You can even use it to learn about Info itself: C-h g(Info). The EmacsWiki is also very helpful, but as it is user-editable, the quality is more variable, so you have to be a bit more careful about what to try.

Above all, don't try everything at once or you will be overwhelmed. That's why I suggested to start by using what is in Emacs already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.