Fork me on GitHub
#parinfer
<
2017-07-17
>
tianshu05:07:06

It's likely emacs parinfer need rewrite for better performance, I'm not sure if it is possible to process whole buffer in a very short time in elisp.

tianshu05:07:35

the logic will be quite simple if always process the whole buffer. otherwise I have to find the begin and end for current sexp, that's really difficult.

shaunlebron05:07:55

yeah, I suppose your choices are 1) make parinfer-elisp faster somehow, or 2) use the parent-expression hack that @chrisoakman used in atom-parinfer

tianshu05:07:14

I use some hack for current version, however a sexp can be very large sometimes, for example, config.clj. In that situation, I delay the processing until user stop typing. but I don't think it's a good idea.

shaunlebron06:07:12

just to be clear, why is it bad to process only after user stops typing?

tianshu06:07:22

if I have a sexp, 1000 lines. I can feel the pause while parinfer processing text.

shaunlebron06:07:11

I mean, can you clarify this? > I delay the processing until user stop typing. but I don’t think it’s a good idea.

shaunlebron06:07:24

i would think that the pause does not drastically affect typing if it only happens after they’re done typing

shaunlebron06:07:41

anyway, we worked pretty hard to ensure parinfer.js was fast for this reason, do you think parinfer-elisp could be made faster? (I haven’t looked at it)

shaunlebron06:07:30

btw, finally updated the site demo to v3: http://shaunlebron.github.io/parinfer/demo

shaunlebron06:07:57

made the necessary site changes using @rgdelato’s branch of atom-parinfer, and it feels pretty good, so I removed the mode option from the site demo

rgdelato06:07:56

Actually, I'm still not sure what's happening with that. Should I make a pull request or is @chrisoakman doing work to move Atom to v3?

tianshu06:07:26

I want to processing in parallel when user is typing. But don't know how to achieve. also, I'm considering using js version parinfer instead of port it to elisp.

shaunlebron06:07:07

@rgdelato not sure, maybe DM him to coordinate?

shaunlebron06:07:27

@doglooksgood neovim-parinfer has had great success with just using js version, and it works really well.

shaunlebron06:07:08

I think that would save a ton of work if it’s currently possible for emacs plugins to shell out to js

shaunlebron14:07:21

driving back home today. going to try to get forceBalance tests done tonight since atom-parinfer will be using it

tianshu16:07:04

how can I try the v3 on atom?

rgdelato16:07:13

@doglooksgood I have a fork that kinda works, if you already have Atom installed, you can try:

git clone 
cd atom-parinfer
git checkout cursor-dx-poc
apm install
apm link
...then restart Atom.

chrisoakman16:07:53

I'll try to push out v3 officially this week.

chrisoakman16:07:59

For atom-parinfer.

tianshu16:07:06

I found something not comfortable

tianshu16:07:55

(defn foo []
  (println {:a 12
            :b 111}
           bar))
when cursor is following println, press backspace, bar will be slurp into {}

tianshu17:07:13

but I enjoy the behavior in v3 when I insert open paren before another open paren.

tianshu17:07:01

then I can delete close paren with delete or ^d to do slurp.

shaunlebron18:07:30

@doglooksgood yeah i call this behavior "sibling adoption" with a test case describe in this section https://github.com/shaunlebron/parinfer/blob/master/lib/test/cases/indent-mode.md#changes

cfleming20:07:11

@shaunlebron I’d need to try it for real, but I can imagine expecting the same as @doglooksgood

shaunlebron22:07:12

yeah i think i agree

shaunlebron22:07:59

that would be inline with @rgdelato's original idea to apply indent mode above and paren mode below the edit

shaunlebron22:07:44

as always, there are edge cases we have to consider. this would require parinfer to know about sibling alignment

shaunlebron22:07:02

e.g. if bar was indented by only two spaces, would you expect it to stick to the map after deleting and reinserting println? @doglooksgood @cfleming