Emacs Rocks! Episode 14: Paredit

emacsrocks · 65K views · 2013 · 3:25

Open on YouTube

Testing, debugging & developer toolsFunctional programmingtutorial

Why Hacker News recommends it

Repeatedly offered as the quickest, most convincing demo of structured editing and why Lisp programmers love paredit.

What it is

A three-minute Emacs Rocks screencast by Magnar Sveen demonstrating paredit, which edits Lisp code structurally as a tree of s-expressions rather than characters.

Recommended by 8 HN commenters across 7 different months, 2013 to 2022.

What Hacker News said

Strong rec Kaali · 2013-06 · on “Clojure Cookbook is now accepting contributions”

For those not familiar with Emacs, IntelliJ IDEA with La Clojure is also an okay choice. I use IDEA for Python, Java and Scala; and still switch to Emacs when I code in Clojure. The reason is that Emacs has really strong toolset for LISP, where many of the features are missing from other environments, or implemented partially. Slime/swank (nrepl replaces it, but I'm just slowly transitioning to it), provides code completion, documentation lookup, REPL, macro expansion and even live code updates on a running application; which can be a bit of a pain to setup on other editors. And the integration in Emacs is really great, as the repl buffer is really just a text buffer, the same as the one you

Recommends wnesensohn · 2013-07 · on “A preview of LightTable 0.5”

I'll be honest with you: I'm maybe not the one to give proper advice on paredit. I'm using C# on my day job, and as such have no use for paredit (I do use ViEmu for VS though, which makes VS bearable) for most of my programming tasks. Also, I've never done anything in clojure. I expect it to be a similar experience to CL, but the different types of parenthesis might have an effect on using paredit efficiently. That said, I found that the following mapping really makes a huge difference when working with sexps & evil-mode: C-l: paredit-forward-slurp-sexp C-k: paredit-backward-barf-sexp C-j: paredit-backward-slurp-sexp C-h: paredit-forward-barf-sexp Your mileage may vary, of course. I mapped i

Recommends 6cxs2hd6 · 2013-12 · 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 [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.

Recommends JackMorgan · 2013-12 · on “Emacs users are like Terry Pratchett’s Igors”

If you pair a majority of the time, sure, make a standardized workstation with your team. My team uses viemu in VS, which the rest of our office detests, but hey, we are the ones pairing 99% of the time. When I am not pairing for the majority, I setup my machine to my tastes, and simply install a "default" editor for the few times someone else actually needs to type on my machine. Emacs and IDEA both have good ways to revert 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 h

Recommends tikhonj · 2014-08 · on “An editor for composed programs”

Emacs's structured editing, in the style of paredit[1], sounds very similar to a text-based version of syntax-directed editing (SDE). Designed for Lisp and S-expressions, it's a system that lets you edit and navigate around nested expressions at a syntactic rather than textual language. As you type, the correct level of nesting is maintained and there are commands for moving and editing code in terms of s-expressions rather than characters. In practice, it's very easy to start using and very powerful... but requires using Lisp. It'll seem odd if you're not regularly a Lisp user. Happily, this idea can generalize well enough to distinctly non-Lisp languages. Structured Haskell mode[2] does th

Recommends peterhadlaw · 2017-05 · 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: [this video]

Recommends medo-bear · 2022-10 · 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] [this video] [1] [LINK]

Recommends gabiruh · 2022-11 · 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!": [this video] It shows how incredible paredit is.