From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Fri, 27 May 2005 11:40:15 -0500 (CDT) Message-ID: <200505271640.j4RGeFw07008@raven.dms.auburn.edu> References: <87y8a3mnz8.fsf@xs4all.nl> <87ll63weye.fsf-monnier+emacs@gnu.org> <200505252135.j4PLZvt26969@raven.dms.auburn.edu> <87hdgrufcl.fsf-monnier+emacs@gnu.org> <200505260359.j4Q3xbj28809@raven.dms.auburn.edu> <87is16rsid.fsf-monnier+emacs@gnu.org> <200505261501.j4QF17h00246@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117212287 7210 80.91.229.2 (27 May 2005 16:44:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 May 2005 16:44:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 18:44:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dbhuf-0004fa-Hx for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 18:42:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbhyy-0003jG-E2 for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 12:46:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dbhxq-0002si-J8 for emacs-devel@gnu.org; Fri, 27 May 2005 12:45:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dbhxm-0002pM-3J for emacs-devel@gnu.org; Fri, 27 May 2005 12:45:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbhxk-0002oo-GR for emacs-devel@gnu.org; Fri, 27 May 2005 12:45:32 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dbhtu-0004US-Fs for emacs-devel@gnu.org; Fri, 27 May 2005 12:41:34 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j4RGecCK014583; Fri, 27 May 2005 11:40:39 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j4RGeFw07008; Fri, 27 May 2005 11:40:15 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: mmaug@yahoo.com In-reply-to: (message from Michael Mauger on Fri, 27 May 2005 14:49:37 +0000 (UTC)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37789 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37789 Michael Mauger wrote: ;; Force font lock to reinitialize if it is already on ;; Otherwise, we can wait until it can be started. (when (and (fboundp 'font-lock-mode) (boundp 'font-lock-mode) font-lock-mode) (font-lock-defontify) (font-lock-mode -1) (font-lock-mode 1)) The `defontify' seems to be the ticket to get font-lock to recalc its settings and actually reperform the fontification. My original solution used internals from font-lock that were not version stable. Actually, contrary to what I said before, the change I will soon propose might not automatically take care of thew `font-lock-face' text property. I believe that font-lock relies on a major mode that sets font-lock-face to disable it, if appropriate, in change-major-mode-hook. From the docstring: Clear out all `font-lock-face' properties in current buffer. A major mode that uses `font-lock-face' properties might want to put this function onto `change-major-mode-hook'. Sincerely, Luc.