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: Wed, 01 Jun 2005 18:55:21 -0400 Message-ID: <87r7flpubg.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> <87is16rsid.fsf-monnier+emacs@gnu.org> <200505261501.j4QF17h00246@raven.dms.auburn.edu> <87psveq60w.fsf-monnier+emacs@gnu.org> <200505271717.j4RHHGD07067@raven.dms.auburn.edu> <200505290157.j4T1vus10117@raven.dms.auburn.edu> <200505292354.j4TNsTE13354@raven.dms.auburn.edu> <200505311544.j4VFijq17680@raven.dms.auburn.edu> <200506011911.j51JBR025269@raven.dms.auburn.edu> <87oeap231t.fsf-monnier+emacs@gnu.org> <200506012242.j51MgBj26277@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 1117666920 27729 80.91.229.2 (1 Jun 2005 23:02:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2005 23:02:00 +0000 (UTC) Cc: Lute.Kamstra.lists@xs4all.nl, dominik@science.uva.nl, mmaug@yahoo.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 02 01:01:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DdcCD-0005Z2-3K for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2005 01:00:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DdcHZ-00032R-HG for ged-emacs-devel@m.gmane.org; Wed, 01 Jun 2005 19:05:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DdcF3-0002l2-Ip for emacs-devel@gnu.org; Wed, 01 Jun 2005 19:03:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DdcEz-0002jE-L6 for emacs-devel@gnu.org; Wed, 01 Jun 2005 19:03:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DdcEz-0002iQ-Fg for emacs-devel@gnu.org; Wed, 01 Jun 2005 19:03:13 -0400 Original-Received: from [209.226.175.97] (helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ddc9U-00054g-IM; Wed, 01 Jun 2005 18:57:32 -0400 Original-Received: from alfajor ([67.71.32.43]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050601225521.GHYU1799.tomts40-srv.bellnexxia.net@alfajor>; Wed, 1 Jun 2005 18:55:21 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 4CEFAD7339; Wed, 1 Jun 2005 18:55:21 -0400 (EDT) Original-To: Luc Teirlinck In-Reply-To: <200506012242.j51MgBj26277@raven.dms.auburn.edu> (Luc Teirlinck's message of "Wed, 1 Jun 2005 17:42:11 -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:38021 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38021 > Can't remember. IIRC there were problems where adding keywords to > comint-mode didn't add them to all derivatives. > So you actually _want_ them added to derivatives. Typically a derivative is a minor tweak and by default it should inherit *all* characteristics of the parent mode. This is not specific to font-lock. > But it you pass comint-mode as argument _in your .emacs_ (as > recommended in the docs), how will it enable them for derivatives? Who said it will? BTW, why did you underscore the "in your .emacs"? Are you implying that things might be different elsewhere? > I have not read through every line of font-{lock,core}.el, so I may have > missed something, but `font-lock-set-defaults' does > (cdr (assq major-mode font-lock-keywords-alist)) > So if it contains (comint-mode . ...), it would appear to have no > effect in shell-mode. And that's the problem. > So what is the difference between passing a non-nil MODE in your > .emacs or from a Lisp program? I have no clue what your talking about w.r.t ".emacs vs Lisp program". By placing the font-lock-add-keywords with a nil arg in the mode's hook, you ensure that the font-lock-add-keywords is also run for derivatives. > It does not say "or in a derivative mode". Of course not: it's a property of major-mode-derivation, not of font-lock keywords. > So, instead of the current cryptic difference between .emacs and > programs, maybe the docstring should say to pass a non-nil MODE > argument if you do not want it to apply to derivatives and a nil one > if you do want it to apply to derivatives. That's pretty ugly, don't you think? It's like saying "use this form to benefit from quirk A or that form if you prefer quirk B". Stefan