clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.53k stars 643 forks source link

paredit problems #182

Closed recursor94 closed 11 years ago

recursor94 commented 11 years ago

I'm having a little bit of paredit trouble in nrepl 0.1.5. In my .emacs I have this line

(add-hook 'nrepl-mode-hook 'paredit-mode)

and paredit, in general works correctly in the REPL buffer. paredit-open-curly and paredit-close-curly do not work, however, when I type the actual '{' and '}' keys. It simply never forms a matching pair.

The second issue is that it can be hard to use paredit in the nrepl buffer when trying to format multiline commands into the buffer without them registering as entered commands.

For example this:

(lazy-seq
   (cons term-3
      (next-terms term-2 term-3)))))

Is difficult to format correctly in the REPL because paredit-close-round will automatically close the first line before creating a newline, RET will enter the code, and C-j will not indent the code in the newline.

Thank you for considering this issue, --recursor

kingtim commented 11 years ago

Yah, I would expect paredit to be a little funky in the repl buffer.

First of all, since it isn't in clojure-mode it won't have the paredit adjustments from that mode for curly braces (e.g. https://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L441).

I see what you mean about the other stuff too.

@bbatsov Thoughts? I am wondering if we should just remove this from the README because supporting it in the repl could be more trouble than it is worth.

bbatsov commented 11 years ago

@recursor94 @kingtim The C-j problem is fixed in 0.1.6 (the current master). I'd rather us just add a warning that paredit is not for everyone (it will be better formulated in my PR) and port the bit about the curly braces. paredit is a major productivity booster, so when might spent a little bit of effort for the greater good of the users of nrepl.el.

bbatsov commented 11 years ago

@recursor94 @kingtim Btw, I just tried out inserting { in the REPL and everything works just fine with latest nrepl.el and the latest paredit (23 beta, installed from MELPA). @recursor94 Can you try this as well and verify that it works?

recursor94 commented 11 years ago

@bbatsov I am now using the latest version of nrepl.el and paredit.el beta and curly braces still aren't working. Indentation seems to be working well though.

bbatsov commented 11 years ago

@recursor94 Hmm, it might be something I've done in Prelude that's making the curly braces work for me. I'll have to investigate it a bit more :-)

recursor94 commented 11 years ago

Alright, thanks for the help!

recursor94 commented 11 years ago

Are you sure this issue has been rectified? I am having the same issue in the latest nrepl.el with the latest paredit.

malcolmsparks commented 8 years ago

I'm finding that this line is causing me problems

https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L238

because my paredit version is not defined - perhaps because:

paredit            20150217.713  installed             minor mode for editing parentheses

Removing that guard from clojure-paredit-setup fixes my problem

bbatsov commented 8 years ago

paredit-version is defined in paredit.el (at the very beginning). Using melpa will not affect it.