DogLooksGood / parinfer-mode

Parinfer for Emacs :)
GNU General Public License v3.0
407 stars 33 forks source link

parinfer--lint support parinfer-partial-process #60

Closed bolasblack closed 6 years ago

bolasblack commented 6 years ago

btw, I found parinfer-smart.el self can not pass parinfer--lint……

DogLooksGood commented 6 years ago

btw, I found parinfer-smart.el self can not pass parinfer--lint……

The parinfer-smart.el itself is not written with parinfer, because parinfer-smart is still under develop and testing. Some close parens are not at the correct position. When development is finished, I will clean the code.

Function parinfer--lint is called before parinfer start, it ensures that parinfer will not harm your code in an unexpected way. I think this is important we do this for whole buffer instead for the current sexp.

considering your code is:

(foo (bar|))
         ^ cursor is here

(defn baz []
(let [x 1]
  x))

After parinfer active, you can move the cursor to the last line, and edit x to (inc x). After these operations, parinfer will correct the last sexp to

(defn baz [])   ;; <--- here's the problem
(let [x 1]
  (inc x))

How do you think about this?

bolasblack commented 6 years ago

make sense, I think it's necessary