emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

font-lock and mode changes.


From: Luc Teirlinck
Subject: font-lock and mode changes.
Date: Sun, 11 Aug 2002 18:52:33 -0500 (CDT)

Take some font-lock fontified buffer and put it in a mode that does
not support font-lock, say fundamental-mode.  The fontification stays.
This is highly inappropriate, because it no longer gets properly
updated and pretty soon the fontification gets funny.  Rear stickiness
makes things worse.

It seems the following or some variant of it would solve the problem:

(defun font-lock-mode-cmmh ()
  (if font-lock-mode (font-lock-unfontify-buffer)))

(add-hook 'change-major-mode-hook 'font-lock-mode-cmmh)

The "if font-lock-mode" is important, because if font-lock-mode is not
enabled, then we not only do not want to waste CPU, but more
importantly, we do not want to erase user-defined and possibly
mode-independent fontification.

I am using Emacs 21.2.90.

Sincerely,

Luc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]