From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Thu, 26 May 2005 10:08:13 -0400 Message-ID: <87is16rsid.fsf-monnier+emacs@gnu.org> 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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117116974 17484 80.91.229.2 (26 May 2005 14:16:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 14:16:14 +0000 (UTC) Cc: dominik@science.uva.nl, Lute.Kamstra.lists@xs4all.nl, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 26 16:16:11 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbJ7E-0004iW-Aq for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 16:13:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbJBJ-0005ni-6h for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 10:17:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbJAF-0005Rf-AJ for emacs-devel@gnu.org; Thu, 26 May 2005 10:16:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbJAC-0005QC-J0 for emacs-devel@gnu.org; Thu, 26 May 2005 10:16:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbJAA-0005K9-QO for emacs-devel@gnu.org; Thu, 26 May 2005 10:16:43 -0400 Original-Received: from [209.226.175.34] (helo=tomts13-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbJ2c-0008Mb-0u for emacs-devel@gnu.org; Thu, 26 May 2005 10:08:54 -0400 Original-Received: from alfajor ([70.49.81.199]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050526140814.EHOC25800.tomts13-srv.bellnexxia.net@alfajor>; Thu, 26 May 2005 10:08:14 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id A9431D7700; Thu, 26 May 2005 10:08:13 -0400 (EDT) Original-To: Luc Teirlinck In-Reply-To: <200505260359.j4Q3xbj28809@raven.dms.auburn.edu> (Luc Teirlinck's message of "Wed, 25 May 2005 22:59:37 -0500 (CDT)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:37700 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37700 > The following changes fix both bugs, by using post-command-hook to > check whether font-lock was enabled for the correct mode and adapting > the turn-on function to be able to correct it. I still will have to > see whether this automatically fixes the second bug for other > functions defined with define-global-mode, or whether some of them > need a slightly different turn-on function too. Can you explain the change? I really don't like the (defun turn-on-font-lock-as-appropriate () (let (font-lock-set-defaults) (turn-on-font-lock-if-enabled))) since it may cause font-lock-keywords to be reset from font-lock-defaults, thus throwing away keywords added via font-lock-add-keywords since. Stefan