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 10:35:22 -0500 (CDT) Message-ID: <200505271535.j4RFZMS06395@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 1117208684 25636 80.91.229.2 (27 May 2005 15:44:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 May 2005 15:44:44 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 17:44:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dbgzn-0002vv-Kq for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 17:43:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbh45-0004zn-Sh for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 11:48:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dbh1G-0003QW-Fv for emacs-devel@gnu.org; Fri, 27 May 2005 11:45:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dbh1B-0003Nv-Mp for emacs-devel@gnu.org; Fri, 27 May 2005 11:45:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbh1A-0003LK-HJ for emacs-devel@gnu.org; Fri, 27 May 2005 11:45:00 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dbgt6-0008Qn-N7 for emacs-devel@gnu.org; Fri, 27 May 2005 11:36:40 -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 j4RFZjCK014320; Fri, 27 May 2005 10:35:45 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j4RFZMS06395; Fri, 27 May 2005 10:35:22 -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:37784 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37784 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. It seems to me, both from docstring and code, that font-lock-defontify only takes care of the font-lock-face text property. After changes I will propose later today to fix two bugs in define-global-minor-mode, (progn (font-lock-mode -1) (font-lock-mode 1)) will reset font-lock for the current mode, if necessary. (After the change, font-lock remembers which mode it was set up for.) I do not believe that this is an incompatible change, as having font-lock enabled for the wrong mode makes no sense. Sincerely, Luc.