Questions tagged [paredit]

Paredit is an emacs minor mode for controlled editing of s-expressions.

Paredit keeps parentheses balanced while editing Lisp source code.

34 questions
13
votes
3 answers

Move form up and down on paredit mode

I've been using cursive's Structural Editing (a paredit-like mode for Intellij and Cursive) and I found a nice command there called move form-up (and down). Move form up does this (the | is the point): (+ 1 |(+ 2 3) 4) => (+ (+ 2 3) 1 4) and Move…
Rodrigo Flores
  • 275
  • 1
  • 7
8
votes
1 answer

Is there a command for tidying trailing parentheses?

When editing lisp code, I often end up with trailing parentheses scattered around (assuming | is point): (defun example-function () (let ((x (+ 1 1))) (when x (message x)| ) )) Are there any convenience commands for fixing…
Wilfred Hughes
  • 6,890
  • 2
  • 29
  • 59
7
votes
1 answer

fill-paragraph (`M-q`) for s-expressions?

With M-q (aka fill-paragraph), it is possible to format a single line of text nicely. Is there a command or function which does a similar thing for lisps s-expressions? It should break one-liner lisp expression where it is reasonable. A command or…
jue
  • 4,476
  • 8
  • 20
7
votes
2 answers

What is the reverse command to paredit-wrap-around?

I am using paredit. Sometimes I accidentely wrap something in curly braces or I have a situation where I want unwrap something for some other reason? What ist the right command to use when undo does not work? I am looking for a command which turns…
Witek
  • 335
  • 1
  • 11
6
votes
4 answers

How to do paredit-kill backwards?

Most everyone who uses paredit has used paredit-kill (i.e., C-k), which allows one to delete a line forwards whilst keeping delimiters balanced properly. But how does one do this in the reverse direction? When one does C-0 C-k, which is something…
GDP2
  • 1,340
  • 9
  • 25
5
votes
1 answer

hippie-expand disturbes paredit

paredit restricts my editing freedom to guarantee me that my s-expressions are never unbalanced. Unfortunately, hippie-expand doesn't care a bit about rules and manages to disturb the balance by expanding to syntactically wrong text (e.g. text…
user2005
4
votes
1 answer

Paredit doesn't close {

I am using paredit. It terminates ( and [ and " fine, but does not close the { in any modes. How can i configure it to do this too? I have emacs24.
user12021
4
votes
1 answer

Editing HTML structurally

Recently I've done a lot of work cleaning up some HTML files that were generated by LibreOffice. It made me really wish for a way to edit the document structure, à la paredit-mode. For example, for some reason LibreOffice rendered one particular…
Sean
  • 929
  • 4
  • 13
3
votes
2 answers

How to move up to the ending parenthesis of the enclosing list (if it exists)?

In paredit mode, C-M-u (paredit-backward-up) is used to move the point backward up out of the enclosing list The point is parked at the beginning parenthesis of the enclosing list. My question is: How to move up one level of sexp similarly but…
tinlyx
  • 1,276
  • 1
  • 12
  • 27
3
votes
1 answer

Key map and vector key sequence

paredit.el has the following example code for setting a keybinding: https://github.com/emacsmirror/paredit/blob/8330a41e8188fe18d3fa805bb9aa529f015318e8/paredit.el#L54 (eval-after-load 'paredit '(progn (define-key paredit-mode-map…
Talespin_Kit
  • 435
  • 2
  • 11
3
votes
1 answer

How to swap s-expressions with paredit?

I often need to swap s-expressions. How can I do that with paredit? I want to do things like the following: (list |1 0) (list 0 |1) or: (list 1 |0) (list |0 1)
Antoine
  • 133
  • 3
3
votes
1 answer

Lispy movement commands that treat atoms and parenthesized s-expressions the same?

lispy-flow almost does what I want. The problem is, though it descends into a parenthesized sexp, it does so only if that parenthesized sexp contains another parenthesized sexp. The fact that it skips over atoms is problematic: there are times when…
BPS
  • 193
  • 4
3
votes
1 answer

Cannot install Paredit

I am new to emacs. I want to install paredit mode on emacs 24. I am using Melpa. When i do M-x package-install RET paredit RET or try to install it from package-list-package i see the error in the minibuffer: Cannot open load file: no such file or…
user12021
2
votes
1 answer

How do I disable paredit-ret in sly-mrepl*?

I am trying to migrate from slime to sly. But I want to use paredit in sly-mrepl. Naive enabling of paredit in sly-mrepl leads to a problem where pressing RET in repl calls paredit-ret. But I want to call sly-mrepl-return. How do I disable…
ruby_object
  • 427
  • 2
  • 12
2
votes
1 answer

How can I insert the backslash character ( \ ) before quotation marks (" ") in Emacs?

I am running Emacs and writing on the scratch-buffer. This is my config file. After executing describe-mode, this is the list of minor modes running: Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor Column-Number…
Pedro Delfino
  • 1,369
  • 3
  • 13
1
2 3