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: [PATCH 2/2] Make font-lock honor parents mode of current major-mode Date: Thu, 10 Feb 2011 13:16:44 -0500 Message-ID: References: <1297190593-4585-1-git-send-email-julien@danjou.info> <1297190593-4585-2-git-send-email-julien@danjou.info> <87ei7hw2mk.fsf@keller.adm.naquadah.org> <87d3n0w8a1.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297361831 25250 80.91.229.12 (10 Feb 2011 18:17:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Feb 2011 18:17:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 10 19:17:07 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pnb4h-00071H-PU for ged-emacs-devel@m.gmane.org; Thu, 10 Feb 2011 19:17:03 +0100 Original-Received: from localhost ([127.0.0.1]:56451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnb4h-0003M8-7f for ged-emacs-devel@m.gmane.org; Thu, 10 Feb 2011 13:17:03 -0500 Original-Received: from [140.186.70.92] (port=35863 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnb4U-0003EF-2v for emacs-devel@gnu.org; Thu, 10 Feb 2011 13:16:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pnb4P-00087p-R9 for emacs-devel@gnu.org; Thu, 10 Feb 2011 13:16:49 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:36944 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pnb4P-00087S-Lc for emacs-devel@gnu.org; Thu, 10 Feb 2011 13:16:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnsFAMS5U01FxIyy/2dsb2JhbACXTY4ddLpFhVwEhQGPMw X-IronPort-AV: E=Sophos;i="4.60,451,1291611600"; d="scan'208";a="91225016" Original-Received: from 69-196-140-178.dsl.teksavvy.com (HELO ceviche.home) ([69.196.140.178]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 10 Feb 2011 13:16:45 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id B1859660C9; Thu, 10 Feb 2011 13:16:44 -0500 (EST) In-Reply-To: <87d3n0w8a1.fsf@keller.adm.naquadah.org> (Julien Danjou's message of "Thu, 10 Feb 2011 10:25:42 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:135853 Archived-At: > #+begin_src: emacs-lisp > (font-lock-add-keywords > 'prog-mode > '(("\\<\\(FIXME\\|HACK\\|XXX\\|TODO\\)" 1 font-lock-warning-face prepend))) > #+end_src > This is not something modes do, I think. But doing that have no effect, > because font-lock does not check inheritance, therefore my patches. The `prog-mode' argument to font-lock-add-keywords is the reason why you'd need to explicitly check inheritance. If you use (add-hook 'prog-mode-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\|HACK\\|XXX\\|TODO\\)" 1 font-lock-warning-face prepend))))) then things can be made to work without ever having to look at the inheritance data. But of course, the above won't work either with the current font-lock.el. That's what we need to fix. Stefan