Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge hi2 #502

Merged
merged 6 commits into from
Mar 25, 2015
Merged

Merge hi2 #502

merged 6 commits into from
Mar 25, 2015

Conversation

gracjan
Copy link
Contributor

@gracjan gracjan commented Mar 11, 2015

No description provided.

@gracjan
Copy link
Contributor Author

gracjan commented Mar 11, 2015

@purcell, @chrisdone, I've been using this branch for a while and I see major improvement over old code. I think we should merge what is here. Opinions?

@purcell
Copy link
Member

purcell commented Mar 11, 2015

👍

@purcell
Copy link
Member

purcell commented Mar 14, 2015

@gracjan Please go ahead and merge this if you're satisfied it's ready.

@gracjan
Copy link
Contributor Author

gracjan commented Mar 14, 2015 via email

@gracjan gracjan force-pushed the wip/hi2 branch 3 times, most recently from 99ee369 to e4c511e Compare March 18, 2015 13:36
@kuribas
Copy link
Contributor

kuribas commented Mar 19, 2015

Maybe it would make sense to only parse when point changes to another line?

@kuribas
Copy link
Contributor

kuribas commented Mar 19, 2015

For example add to post command-hook:

  • if last-point-line != current-line then parse and display overline, set last-point-line <- current-line
  • else do_nothing

@gracjan
Copy link
Contributor Author

gracjan commented Mar 19, 2015 via email

@kuribas
Copy link
Contributor

kuribas commented Mar 19, 2015

A timer is rather arbitrary. The method I described will only parse when necessary.

@kuribas
Copy link
Contributor

kuribas commented Mar 19, 2015

Or use both...

@gracjan
Copy link
Contributor Author

gracjan commented Mar 19, 2015

post-command-hook is invoked after any command, be it cursor movement, a change or unrelated. I do not know any way to know that a file got changed by a command, so we need to take the worst case scenario in account, that is that post-command-hook is called after a command that changed the file and did not move the cursor.

And times is also good because it moves expensive computation out of interactive loop.

@kuribas
Copy link
Contributor

kuribas commented Mar 19, 2015

There are not many problematic cases where a command changes the buffer but leaves the current line the same. The only one I can think of is changing or editing a keyword as the first token on the current line. This will change the indentations. That could be easily checked for.
A replace-string might change indentations, but in that case it is likely that it has messed up other indentations, so the user would need to clean that up anyway.
Having a lengthy computation in a timer doesn't feel right, and it may still run too often for low-end machines. There were already people complaining that the parser was to slow (in the original mode).
From the emacs-lisp manual: "Indeed, for a timer to call a function that takes substantial time to run is likely to be annoying."

Conflicts:
	haskell-indentation.el
gracjan added 5 commits March 22, 2015 18:12
Showing overlays calculated indentation positions and that is a costly
function that should not can called at every cursor movement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants