Lurker News

Comments (134) 36 threads

Blackthorn#
To copy a comment I made elsewhere: I'm seriously impressed. This is amazing.

Paredit always ended up being a requirement for me, but this takes it to the next level. What other editing problems out there could have excessive hotkey usage replaced by something automatic with the same level of power, I wonder? This is a great example of an area where user interaction experts can really have a lot of impact, and I think shows why engineers ought to be more accepting of disciplines like that.

chrisoakman3 replies#
Hi folks -- I've been working with Shaun on the tail end of this project.

Have an early prototype of Parinfer working with the Atom editor here: https://github.com/oakmac/atom-parinfer
It's pretty early software, but feedback appreciated :)

cnp1 reply#
Parinfer + Atom -- what a dream come true. Awesome work. (Edit: just took it for a spin, and it "just works", even with atom-vim -- doubly awesome. I really feel like having to navigate parens while learning the language was such a barrier to diving in to ClojureScript. Cant wait to get started.)
chrisoakman1 reply#
This comment makes me so happy; thank you :)

I'm glad it "just works"!

omginternets1 reply#
Your project seriously makes me want to learn lisp.

Continue this thread — 1 reply

l1ambda1 reply#
Wow. Could it also work with JavaScript?
chrisoakman1 reply#
Not really due to the fundamental difference between Lisp and JavaScript syntax.

You could borrow the idea of indentation inferring function scope structure and make a plugin that would modify JavaScript syntax accordingly, but I'm not sure that would even be desirable when writing JavaScript.
Parinfer is made possible by Lisp's unique syntax.

herrvogel-#
I can't thank you enough for this! It's just awesome! I really enjoy learning Clojure / ClojureScript and with Parinfer it will be even more fun! Thanks
ChicagoBoy11#
I don't know what's more impressive: The work itself or the beautiful documentation which accompanies it. Very impressed!
msbarnett#
This reminds me more of Paredit, in that it handles s-expression aware source transformations, and not just indentation:

http://emacsrocks.com/e14.html
I would deeply love to see this kind of inference engine ported to emacs as an alternative to Paredit's chords

alphapapa#
Wow! This is fantastic! This seems to do just what Parinfer does. Why isn't this mode more well-known?

This makes it even better:

    (defun my/lisp-dedent-adjust-parens ()
      (interactive)
      (save-excursion
        (x4-smarter-beginning-of-line)
        (call-interactively 'lisp-dedent-adjust-parens)))
    (defun my/lisp-indent-adjust-parens ()
      (interactive)
      (save-excursion
        (x4-smarter-beginning-of-line)
        (call-interactively 'lisp-indent-adjust-parens)))
    (local-set-key (kbd "") 'my/lisp-dedent-adjust-parens)
    (local-set-key (kbd "") 'my/lisp-indent-adjust-parens)
Now you can just M-left and M-right to adjust the indentation of any line, regardless of where the point is, and adjust-parens fixes the parens for you.

Load more comments