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: Wed, 1 Jun 2005 17:42:11 -0500 (CDT) Message-ID: <200506012242.j51MgBj26277@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> <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> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117666025 25533 80.91.229.2 (1 Jun 2005 22:47:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2005 22:47:05 +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 00:46:52 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ddby2-00046d-KV for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2005 00:45:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ddc3P-0007wi-U8 for ged-emacs-devel@m.gmane.org; Wed, 01 Jun 2005 18:51:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ddc1C-0006t4-8u for emacs-devel@gnu.org; Wed, 01 Jun 2005 18:48:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ddc0z-0006mt-Si for emacs-devel@gnu.org; Wed, 01 Jun 2005 18:48:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ddc0z-0006lC-M8 for emacs-devel@gnu.org; Wed, 01 Jun 2005 18:48:45 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DdbxL-0004Qg-7L; Wed, 01 Jun 2005 18:44:59 -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 j51MgnCK004525; Wed, 1 Jun 2005 17:42:49 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j51MgBj26277; Wed, 1 Jun 2005 17:42:11 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@iro.umontreal.ca In-reply-to: <87oeap231t.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 01 Jun 2005 17:21:36 -0400) 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:38020 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38020 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. That was not at all obvious. The actual patches I sent will add them to derivatives as long as the mode conventions are followed. But it you pass comint-mode as argument _in your .emacs_ (as recommended in the docs), how will it enable them for derivatives? 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. So what is the difference between passing a non-nil MODE in your .emacs or from a Lisp program? In effect this is what the docstring of font-lock-keywords-alist says: Each element has the form (MODE KEYWORDS . APPEND). `font-lock-set-defaults' adds the elements in the list KEYWORDS to `font-lock-keywords' when Font Lock is turned on in major mode MODE. It does not say "or in a derivative mode". 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. I believe that after such doc fixes (which I could make) to the font-lock-{add,remove}-keyword and the Elisp manual, my patches would do exactly what the revised docs would say. What happens to keywords in an _interactive_ mode change, that is during kill-all-local-variables is a separate problem, not related to `define-global-minor-mode'. Sincerely, Luc.