9

I'm trying to switch to Emacs from Vim for a few months and faced the strange problem: when font-lock is on, scrolling in emacs becomes very slow. Example of relevant part of config:

(require 'vimpulse)
(require 'font-lock)
(require 'color-theme)

(global-font-lock-mode 1)
;;(setq font-lock-maximum-decoration t
;;font-lock-maximum-size nil)
;;(setq font-lock-support-mode 'fast-lock-mode ; lazy-lock-mode
;;  fast-lock-cache-directories '("~/.emacs-flc"))

It's slow even on relatively small files starting with a couple of hundreds rows. Seems that this is not a very common problem, cause I did not find any clear solution so far.

GNU Emacs 23.1.1 Ubuntu 10.04

Drew
  • 29,895
  • 7
  • 74
  • 104
voidlizard
  • 805
  • 5
  • 10

3 Answers3

3

Bold fonts are likely the problem.

I personally got a copy of a definition of a color-theme in my .emacs.el and changed it to get rid of much of the bold attributes. This way I got a theme I like without to much penalty.

(require 'color-theme)
(defun color-theme-youlike ()
  (interactive)
  (color-theme-install
   '(color-theme-youlike
     ((foreground-color . "black")
      (background-color . "white")
      (mouse-color . "sienna3")
      (cursor-color . "HotPink")
      (border-color . "Blue")
      (background-mode . light))
     (default ((t (nil))))
...
     (show-paren-mismatch-face ((t (:foreground "white" :background "purple")))))))
(set-default-font "Monaco-12")
(color-theme-youlike)

Hope it works for you also.

Marco
  • 31
  • 2
0

You turned off fast and lazy locking. I think both of these were engineered to improve the responsiveness and behavior of font-lock in various scenarios. I'm curious why you'd turn them off. To learn more about that stuff, what they do and when you should use them, read the comments in the lasy-lock and font-lock.el files. (I think)

Cheeso
  • 189,189
  • 101
  • 473
  • 713
  • FYI, emacs 23.2.1 tells me (`C-h v font-lock-support-mode`) that `jit-lock-mode` is preferred over `fast-lock-mode` and `lazy-lock-mode`. – phils Nov 07 '10 at 21:38
  • I've tried different combinations of fast/lazy locking, whatever. There is the version that coloring modes I've used are implemented by ineffective way: say, coloring mode for Ocaml is working slow when coloring mode for C is ok with the same options (fast/lazy and so on). Now I've just left emacs away and have returned to vim. I just need a good source code editor. – voidlizard Nov 09 '10 at 05:55
0

You can start with 'emacs -Q', eval (global-font-lock-mode 1), and see if it still reproduces. if yes, file a bug; if no, check your installed site-lisp..

xwl
  • 840
  • 10
  • 12