Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: very slow scrolling with font-lock/syntax coloring

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

like image 684
voidlizard Avatar asked Oct 03 '10 09:10

voidlizard


1 Answers

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.

like image 168
Marco Avatar answered Sep 22 '22 22:09

Marco