-
Notifications
You must be signed in to change notification settings - Fork 167
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
markdown-mode hangs Emacs #44
Comments
I'm getting this also. My file is very small. Looking around briefly it appears this happens on all files. I just upgraded this morning. If I can be of more help, please let me know. |
Can you check to see whether the recent commits improved things? |
I have no quantitative data but I think it's better now. It doesn't hang anymore when using Edit: actually, the "typing fast" lag depends on where I am located in the file. Do you see any reason for this? |
Thanks for checking! I used the profiler to scroll through a large (> 5000 line) file and it is now much faster for me. I didn't check typing. Parsing Markdown accurately and in real time is difficult, but I will keep working to make it more efficient. I will try profiling when entering text into a large file as well to see where the bottlenecks are. |
Further profiling revealed that the insertion lag was mostly due to the after-change hook that performs wiki link fontification. I will have a patch ready soon that substantially speeds things up! |
Works great for me now. Thanks very much! |
@hut8 Great—I'm glad it's working better now. @alecigne I just saw your edit. It does make sense that it could be better or worse depending on the surrounding context. Some regions may be more difficult to parse than others. When you insert characters, things have to be parsed again in case the syntax changed. I just pushed commit acf7c5e which I think should essentially eliminate the lag when typing. Please let me know if not. For me, this makes any lag almost imperceptible in my 5000+ line file, but if it doesn't work for you then I may ask for a more specific test case. Another thing you can do to increase performance is to set |
Hi, Thank you for looking into this. Commit acf7c5e doesn't fix the lagging problem. My file is actually my PhD thesis and thus contains a LOT of references in the format:
or
That may be the source of the problem. This is a format understood by As for now, I will continue to use markdown-mode under version 01dc652. |
One option is to obfuscate your thesis while preserving the syntax. Then I could see first hand what is happening. If you are on Linux or OS X, may I suggest using
It translates all letters to 'x' and all numbers to '1'. If that's sufficiently obfuscated, then you could email the file to me at jrblevin@sdf.org. Edit: Of course, if your thesis is in French this won't handle some letters. You also could do it in Emacs:
Obviously, back up your thesis first :) |
I have also created a new branch to help us diagnose the problem without disturbing the main branch: https://github.com/jrblevin/markdown-mode/tree/diagnose-44 There are two commits of interest right now. Both are based on the current
Could you check number 2 first and if that doesn't work, also try number 1? Thanks for your patience while we narrow this down. |
Hi, The new version of the function (commit a8af698) fix the lagging problem. For what it's worth, c428fe9 does as well. My thesis is indeed in French, and is about biology – so in a way it is already pretty well obfuscated! But all jokes aside if you still need the file despite the new working function, let me know and I will send it to you. Again, thank you for your quick response. |
Excellent! Likewise, thanks for testing out these changes so quickly and helping improve markdown-mode! Good luck with your thesis—it's an honor that you're writing it in markdown-mode. Let me know if you have any other issues. |
Hi,
I work on a fairly large markdown file (126k) and commit 86e0c76 (from Dec 16) hangs Emacs regularly (it lags when I type fast, lags when I use
scroll-up-command
orscroll-down-command
, etc.). Everything works fine with the previous commit. I also tried with a minimal init file, only requiringmarkdown-mode
, and the problem is the same.I'd like to be able to provide more details here but I don't know how to proceed.
Thank you
The text was updated successfully, but these errors were encountered: