4

I have some files which are more than 2000 lines. It's very painful to edit these files because editing will become very slow and so does scrolling (scroll up, scroll down, page up, page down).

I have tried to solve this problem based on the following posts on EmacsWiki:

but I still have the same problem. Could anybody help me?

Here is some more information that might be of interest:

  • Emacs version: 24.3 on Ubuntu 13.04

  • erlang-mode version: erlang-20130912 from MELPA, Erlang: R16B01

  • I use: erlang-mode, outline-minor-mode, auto-complete, flymake, distel-mode, prelude-mode, helm-mode, projectile-mode, linum-mode

  • If I turn off font-lock-mode, it will speed up but I lose syntax highlighting.

  • I have tried editing the lib_event source file http.c which has 4000 lines, and the speed is quick, I just wonder why editing my Erlang source file is so slow. Maybe it's because I use level 4 syntax highlighting for Erlang; if I use level 2 or level 3 it will be faster. So, I still think it's the font-lock problem because c-mode syntax highlighting is less complicated than syntax highlighting in erlang-mode.

  • There might also be a problem in erlang-mode: I found that when I page-down or up, it will read and write to the disk which is very weird.

itsjeyd
  • 5,070
  • 2
  • 30
  • 49
algking
  • 367
  • 3
  • 7
  • 2
    It's important to state which mode the files are (i.e. C++ / org-mode ... ). In any case, `find-file-literally` will always work. – abo-abo Oct 14 '13 at 08:00
  • 1
    I don't think it should be that slow. You can use `M-x report-emacs-bug` to report it if you think it's a bug. – Tom Oct 14 '13 at 13:06
  • 3
    I've seen problems of this nature with certain major modes and linum-mode. If you are using linum-mode, try disabling it to see if that fixes the slow down. – lawlist Oct 14 '13 at 15:09
  • One of Emacs's own source files has 20 thousand lines, so I can assure you that Emacs has no such "2 thousand lines" limit. IOW the problem has to be triggered by a specific kind of file, or by some local configuration. – Stefan Oct 14 '13 at 16:56
  • @Stefan Yes,I tried the lib_event source file http.c, which has 4 thousand lines,and the speed is quick,I just wonder why my erlang source file is so slow.Maybe it's because I use the level 4 syntax highlight in erlang,if I use level 2,or level 3 it will be faster. So,I still think it's the font-lock problem. Maybe there is also some problem in erlang-mode ,i found when I page-down or up ,it will read and write the disk which is very weird. – algking Oct 15 '13 at 01:37
  • Might be a performance problem in erlang-mode, indeed. Contact the authors to figure it out. – Stefan Oct 15 '13 at 01:40
  • Try running emacs with -q option, then: 1. Load the file and try scrolling. Still slow? 2. Load the file, set the file in fundamental mode. Still slow? If #2 was still slow, then it is indeed your emacs. If #1 was slow, but not #2, then it is the mode. If #2 and #1 is slow, then it is some configuration you have – dmg Oct 27 '16 at 07:01

0 Answers0