Skip to content
0:00 / 0:00

#emacs#paredit#lisp

Emacs Rocks! Episode 14: Paredit

emacsrocks

7.1K subscribers • 6 videos on Hallway

YouTube
  • Recommended by 8 people: 8 on Hacker News.
  • A classic. People kept recommending it from 2013 to 2022.

Intermediate. Assumes working knowledge.

65K views13 years ago8 recommendations

Tools and practiceProgramming languagesVim, Emacs and editorsLisp and Clojure

Magnar Sveen demonstrates how to use Paredit for structural editing of Lisp code in Emacs.

emacsrocks.com - Rocking emacs tricks and tips screencast. Follow me on twitter: @emacsrocks

Why it's here

8 people recommend this

What people say. Highly recommended as the classic, quick demonstration of the power of structural editing with Paredit.

Kaalion Hacker News • Recommends

On “Clojure Cookbook is now accepting contributions”

…me as the one you are coding in. But the biggest reason for me to code LISP in Emacs is paredit. It really makes all the trouble with balancing parenthesis and moving around the sexps really easy. It might seem counter intuitive and a bit troublesome at first, but I really recommend you to try it. For a short and enthusiastic video on paredit, see link to this video -- and maybe the other Emacs Rocks! videos to learn more about modern Emacs.…

wnesensohnon Hacker News • Recommends

On “A preview of LightTable 0.5”

…ard-barf-sexp C-j: paredit-backward-slurp-sexp C-h: paredit-forward-barf-sexp Your mileage may vary, of course. I mapped it this way because my fingers dictated it, and it plays well with vim/evil. As to how to actually use these commands: Try them out on a few sexps, it'll be clear to you pretty soon. Also be sure to check out Emacs Rocks! ep14 ( link to this video ), it's well worth the 3:40. I actually find learning paredit to be very similar to learning vim: You start with almost nothing (maybe hjkl in vim, but even that takes a while to get used to), and slowly add new tricks to your tool belt. Also like with vim, everyone has their own style of using the tools. Of course, there's a ton of other t…

6cxs2hd6on Hacker News • Recommends

On “Lamdu - towards the next generation IDE”

There's a structured editing mode for Emacs called Paredit, to use for s-expression languages like Lisp, Racket, Clojure. Since the AST for such languages is s-expressions, and some people struggle with parens, this is an interesting "fun size" example of editing the AST. The thing is, paredit is quite challenging for most people to adopt, due to what you mentioned about the "flow" they've already learned. Magnar Sveen has a great video about this at link to this video Best quote: "If you think paredit is not for you, then you need to become the kind of person that paredit is for." EDIT: To clarify, Magnar is quoting technomancy a.k.a. Phil Hagelberg.

JackMorganon Hacker News • Recommends

On “Emacs users are like Terry Pratchett’s Igors”

…t everything to defaults temporarily. I do not believe, however, that a perfectly customized setup has only small gains. For example, consider two tools that I have never seen as defaults in any editor or IDE: rainbow parens/brackets and paredit mode. Rainbow parens just highlights pairs: link And here is a short minute paredit mode explanation: link to this video When actually editing code, those two tools save me several hundred keystrokes an hour. And those are just the first two tools I thought to use as an example out of the entire toolbox that is emacs. If I was to now give up just those two tools, I would be sentencing myself to the mental equivalent of tying five pound weights to my legs for…

tikhonjon Hacker News • Recommends

On “An editor for composed programs”

…iting—but it shows that the necessary foundation is possible with a perfectly normal text editor. It would be interesting to see if some of the ideas from Eco could be added to structured editing modes like this without requiring you to use an external, self-contained editor. 1: link 2: link Also, here's a great video of Paredit in action: link to this video…

peterhadlawon Hacker News • Recommends

On “Is Clojure dying, and what has Ruby got to do with it?”

The parentheses end up serving as a tool to speed up the development process with tool like paredit. You end up manipulating the "tree" of code vs the characters on a line. Check this out: link to this video

medo-bearon Hacker News • Recommends

On “The Hidden Origins of Lisp (2015)”

not op but for me structured editing is one of the biggest pluses when it comes to editing lisp code. here is a good example of what i mean 0. btw autolisp standard formating is kind of an anti-example of good lisp formating. in emacs lots of excellent tools exist to make parantheses an extremely helpful feature 1 0 link to this video 1 link

gabiruhon Hacker News • Recommends

On “Paredit 25 released (after 8 years)”

Yeah... a couple GIFs would. If I was them I would've just embedded this video from "Emacs Rocks!": link to this video It shows how incredible paredit is.

u/chrisdonerin r/haskell • Mentions

On “Rascal is now Hackett, plus some answers to questions”

Editing/manipulating Lisp, armed with paredit, is _transformative_. It changes the way you work. My structured-haskell-mode tries to be that for Haskell, but Lisp is _far_ easier. Paredit guarantees there is always a valid read (in the Lisp sense). You have to go out of your way to cause breakage. There're characters in a language that can cause breakage when not balanced. Incomplete syntax in Lisp consists basically of mismatched `"` and `()`. For Haskell, there are tonnes of ways things can be broken (`case`, `of`, `->`, `<-`, `deriving`, `::`, `let/in`, `let` in a `do`, indentation!, `|`, `if/then/else`, **operators with precedence and fixity!!**, ...), and that makes manipulating it r…

u/chrisdonerin r/haskell • Mentions

On “Haskell &amp; Rust &lt;3”

Lisp syntax is regular because it's just plain words grouped with parens. You can write a parser in an hour. It reads like pseudo code. Editors have no problem parsing it, formatting and editing it. Haskell's syntax is full of exceptions, writing a complete parser takes a month. I suspect if it's hard to write a parser for, that translates to being hard for humans to comprehend too. Not to mention hard as hell to write a good editor and code formatter for. The fact that precedence rules come from user-specified rules that the compiler holds onto makes that even harder to tool, and hard for newbies to grok. That's Haskell 98 - not including the plethora of syntactic extensions. The learnin…

m1elon Hacker News • Mentions

On “Why Don't We Have a General-Purpose Tree Editor? (2014)”

Emacs has ParEdit minor mode which is a general-purpose tree editor. link edit: paredit demos: Productive Emacs: Paredit link Emacs Rocks! Episode 14: Paredit: link to this video