Questions tagged [paredit]

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

Paredit keeps parentheses balanced while editing Lisp source code.

65 questions
6
votes
2 answers

Wrapping braces around text?

When using paredit how do you wrap braces around text? I've used paredit several times however I get frustrated because it stops me from doing what I want. Example: (foo (bar 1 2 3) baz 1 2 3) Opps, baz 1 2 3 should be wrapped like…
AnnanFay
  • 9,573
  • 15
  • 63
  • 86
6
votes
3 answers

Emacs Clojure mode without paredit

I'm using the Clojure mode package from ELPA. Otherwise everything is fine, but I just can't stand paredit mode. I can't seem to turn it off easily, now I just disable it for every buffer I open. I tried setting this variable to nil: (setq…
auramo
  • 13,167
  • 13
  • 66
  • 88
6
votes
2 answers

Show Parentheses When Inside Them - Emacs

In emacs there is a mode show-paren-mode which colors the opposite matching parenthesis when the cursor is on the other. I wrote an example explaining show-paren-mode: ( <-colored colored-> )| <-cursor However it does not work when the cursor is…
Spenser Truex
  • 963
  • 8
  • 24
6
votes
2 answers

how to wrap forms with an already written outer form in paredit

Suppose I have this code (hello world) (hi world) Then it comes to my mind that I should wrap that with the following form: (let (acc) <> (nreverse acc)) resulting in this code: (let (acc) (hello world) (hi world) (nreverse acc)) Here…
Jisang Yoo
  • 3,670
  • 20
  • 31
6
votes
2 answers

How to avoid extra space character when slurping first expression

When using Paredit, I'm often confronted with the following (pipe char represents cursor): (foo |bar baz) I want to enclose bar in parens, so I use paredit-wrap-around (M-() to get this: (foo (|bar) baz) The same applies when I want to put bar…
joelittlejohn
  • 11,665
  • 2
  • 41
  • 54
6
votes
5 answers

Swap parentheses and square brackets in Emacs Paredit

How can I define a command in paredit mode that swaps parentheses and square brackets?
namin
  • 37,139
  • 8
  • 58
  • 74
6
votes
7 answers

Using Paredit to wrap existing expression

I'm using Emacs in Paredit mode for Lisp code. I'm trying to wrap a function call in println: (square 5) (println (square 5)) What ends up happening in paredit is this: (square 5) (println) (square 5) There is no way i can delete closing paren of…
Sathish
  • 20,660
  • 24
  • 63
  • 71
5
votes
2 answers

Search and replace on variable name within S-Expression (lexical scope)?

Using emacs with Paredit enabled. How can I search through a LISP (Clojure) S-expression and rename a variable? I'd like to do it within the current S-expression instead of globally.
Eric Schoonover
  • 47,184
  • 49
  • 157
  • 202
5
votes
3 answers

Delete current (non-atomic) s-expression in Emacs

Is there an easy way to delete the smallest-possible non-atomic s-expression based on the cursor location? I want to turn this (the "|" is the cursor) (defun foo (bar) (if bar |789 (+ 456 123))) into this (defun foo (bar) |) It seems…
Patrick Brinich-Langlois
  • 1,381
  • 1
  • 15
  • 29
5
votes
1 answer

Delete extra brackets in Counterclockwise strict paredit mode

I'm sure the answer to this question is obvious, but I've read the Counterclockwise documentation and searched on the internet and haven't been able to find it. I frequently end up accidentally putting extra brackets, parens, etc while editing…
4
votes
2 answers

Using SLIMV to code Lisp, how do I insert a single " without disabling paredit.vim?

I need to write the following line of code: ((eq item #\") (do-this...)) But everytime I type ", I get "". I've read the paredit.vim doc file but it's not clear how to insert a single pair character (be it ", (, or [), and whether doing it breaks…
bgibson
  • 17,379
  • 8
  • 29
  • 45
4
votes
3 answers

Emacs php-mode and paredit

I would like to use paredit in combination with php-mode, but it doesn't add a closing curly bracket "}". Might this have something todo with the fact that an electric brace is bound to "{"? And how could I overwrite this? Thanks.
Beatlevic
  • 605
  • 1
  • 6
  • 13
4
votes
2 answers

Light Table : parentheses are not auto-closing

I'm trying to edit Clojure/ClojureScript files on Light Table with paredit, but the Plugin does not seem to work. When I open a parenthesis, it is not closed. However the plugin is installed as shows the plugins list. Have I missed some…
Valentin Waeselynck
  • 5,950
  • 26
  • 43
4
votes
1 answer

How do I enable Paredit in Light Table?

I'm new to Light Table, and I'm accustomed to using paredit. The plugin manager tells me I've got the Paredit plugin installed, but I can't figure out how to enable it. I can see the paredit commands in the command pane by typing in "paredit", but…
Conan
  • 2,288
  • 1
  • 28
  • 42
4
votes
2 answers

Defadvice for C-k in emacs for js-mode

I want to use the C-k to kill a block or kill the rest of current line in js-mode. After I search google for a while, I think defadvice will be the answer but I am not familiar with elisp. So I hope somebody can help me write it :) The function I…
Saddle Point
  • 3,074
  • 4
  • 23
  • 33