Re:The Animated Guide to Emacs Paredit
by iolsantr on Wednesday November 26, 2014 @01:00PM
(#8663638)
I think paredit is one of the best arguments for simple sexp style syntax. It allows you to build easily comprehensible tools that manipulate code on syntactic rather than textual level. Its definitely possible to build the same kind of tools for more complex syntaxes, but its harder for users to understand and use those tools.
Re:The Animated Guide to Emacs Paredit
by dyadic on Wednesday November 26, 2014 @01:44PM
(#8663922)
It's quite surprising to see something I wrote turn up here.
When I first started with Paredit I struggled to absorb the functions and key bindings from the manual and cheat sheets well enough so that I could use them while writing code. I know that seeing them in action would have helped me a lot, so I made this and put it out there, I really hope that it can help other people to start using more of Paredit.
This will let your fn key (which if you're clever you've defined as 'hyper', though it doesn't matter here) + arrow keys work for the fundamental paredit commands.
Re:The Animated Guide to Emacs Paredit
by weavejester on Wednesday November 26, 2014 @02:40PM
(#8664215)
I've read comparisons between smartparens and paredit, but I haven't found the case for smartparens compelling enough to switch. Are there any features in smartparens that paredit lacks that you feel you can't live with out, or make your life easier?
Re:The Animated Guide to Emacs Paredit
by michaelsbradley on Friday November 28, 2014 @01:51PM
(#8671776)
Good question.
Smartparens is actively maintained, which for me is an attractive "feature" when evaluating any tool that is to find a prominent place in my workflow. Also, its extensible design allows it to be used with languages and data formats other than lisp/scheme dialects, so it has a broader reach than paredit.
As for wrangling sexprs in, say, Clojure, I think paredit and smartparens are one equal footing. I still stand by my original statement inasmuch as I think smartparens is a worthy successor to paredit.
Re:The Animated Guide to Emacs Paredit
by weavejester on Friday November 28, 2014 @10:03PM
(#8672936)
I haven't yet, but I intend to when I get some time. I was hoping to find someone else to give me an opinion on how it compared to paredit and smartparens, before I tried it out :)
Re:The Animated Guide to Emacs Paredit
by retrogradeorbit on Wednesday November 26, 2014 @10:00PM
(#8665796)
I've been using paredit with my clojure for a while now and I really love it. But how do I get those multi coloured matched brackets? I've seen them on others screenshots too, but I don't know which mode enables them in my emacs.
Also, I've found with paredit that it keeps the brackets balanced until I paste in a segment of lisp with unmatched brackets. Then it gets in a bind and I need to either disable paredit to manually fix it, or go into overwrite mode to fix it. Is there any graceful way to deal with bad bracket-unmatched code pasting in paredit?
As for the unbalanced delimiters, I just M-x paredit-mode, turn it off, make my fixes (which is easy because rainbow delimiters shows me exactly which delimiter is out of place), and then turn it back on again.
Re:The Animated Guide to Emacs Paredit
by karthink on Thursday November 27, 2014 @03:28AM
(#8666440)
An easier way to deal with unbalanced delimiters without toggling paredit-mode is to use C-q, quoted-insert. C-q ) inserts a literal ) where regular ) is bound to paredit-close-round.
Quoted insert is generally useful when you want to enter a specific character that is bound to something other than self-insert, such as a literal newline in a regex pattern.
Re:The Animated Guide to Emacs Paredit
by adwf on Thursday November 27, 2014 @09:19AM
(#8667357)
Yep, C-q is also useful when you need to comment out part of a multiline sexp without doing a block select and C-;
Otherwise paredit will helpfully move the comment to a newline to avoid breaking the balance ;)
Re:The Animated Guide to Emacs Paredit
by nyir on Wednesday November 26, 2014 @10:54AM
(#8662855)
For the bonus, paredit-convolute-sexp is useful exactly for the case they show, moving a binding/wrapping form some levels up. It saves a lot of keystrokes when you're in that situation.
When I first started with Paredit I struggled to absorb the functions and key bindings from the manual and cheat sheets well enough so that I could use them while writing code. I know that seeing them in action would have helped me a lot, so I made this and put it out there, I really hope that it can help other people to start using more of Paredit.
If someone else has more time than I do please run with the idea. I'll help test it!
https://github.com/Fuco1/smartparens
I love the animated tutorial, though. Something along those lines would be a great way to augment smartparens' docs.
Smartparens is actively maintained, which for me is an attractive "feature" when evaluating any tool that is to find a prominent place in my workflow. Also, its extensible design allows it to be used with languages and data formats other than lisp/scheme dialects, so it has a broader reach than paredit.
As for wrangling sexprs in, say, Clojure, I think paredit and smartparens are one equal footing. I still stand by my original statement inasmuch as I think smartparens is a worthy successor to paredit.
Have you tried it? If so, what do you think of it with respect to paredit?
(I still use paredit for lisp languages though, and I can't remember if there was a reason for that or it's just inertia/conservatism).
http://www.reddit.com/r/emacs/comments/2ngqi6/the_animated_g...
time for a new standard ? #927
Also, I've found with paredit that it keeps the brackets balanced until I paste in a segment of lisp with unmatched brackets. Then it gets in a bind and I need to either disable paredit to manually fix it, or go into overwrite mode to fix it. Is there any graceful way to deal with bad bracket-unmatched code pasting in paredit?
http://www.emacswiki.org/RainbowDelimiters
As for the unbalanced delimiters, I just M-x paredit-mode, turn it off, make my fixes (which is easy because rainbow delimiters shows me exactly which delimiter is out of place), and then turn it back on again.
Quoted insert is generally useful when you want to enter a specific character that is bound to something other than self-insert, such as a literal newline in a regex pattern.