unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: font-lock and mode changes.
Date: Sun, 11 Aug 2002 18:52:33 -0500 (CDT)	[thread overview]
Message-ID: <200208112352.SAA07764@eel.dms.auburn.edu> (raw)

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	other threads:[~2002-08-11 23:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-11 23:52 Luc Teirlinck [this message]
2002-08-13  1:48 ` font-lock and mode changes Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200208112352.SAA07764@eel.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).