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, 25 May 2005 11:24:12 -0500 (CDT) Message-ID: <200505251624.j4PGOBF24551@raven.dms.auburn.edu> References: <87y8a3mnz8.fsf@xs4all.nl> <87ll63weye.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117038607 31674 80.91.229.2 (25 May 2005 16:30:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 May 2005 16:30:07 +0000 (UTC) Cc: emacs-devel@gnu.org, Lute.Kamstra.lists@xs4all.nl, dominik@science.uva.nl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 25 18:30:05 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dayjo-0003FD-T8 for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 18:28:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dayni-0001ma-DY for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 12:32:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Daymf-0001SO-F0 for emacs-devel@gnu.org; Wed, 25 May 2005 12:31:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Daymb-0001Ql-8l for emacs-devel@gnu.org; Wed, 25 May 2005 12:31:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DaymZ-0001KK-Pl for emacs-devel@gnu.org; Wed, 25 May 2005 12:30:59 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Daygo-0001gI-2p for emacs-devel@gnu.org; Wed, 25 May 2005 12:25:02 -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 j4PGOVCK006503; Wed, 25 May 2005 11:24:31 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j4PGOBF24551; Wed, 25 May 2005 11:24:12 -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: <87ll63weye.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 25 May 2005 10:45:08 -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:37624 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37624 Stefan Monnier wrote: While I think that org-mode should use define-derived-mode, I'm wondering why it's a problem that after-change-major-mode-hook is run at the wrong time. Because users of after-change-major-mode-hook should be able to rely on the fact that it is run at the very end of the mode. Hooks should be run as documented. >>From `(elisp)Mode Hooks': -- Variable: after-change-major-mode-hook Every major mode function should run this normal hook at its very end. It normally does not need to do so explicitly. Indeed, a major mode function should normally run its mode hook with `run-mode-hooks' as the very last thing it does and `run-mode-hooks' runs `after-change-major-mode-hook' at its very end. After all, such manual mode derivation (without using define-derived-mode) is pretty common, so if there's a problem with it, we should fix it. I believe that we plan to eventually make all modes run `after-change-major-mode-hook', usually as a byproduct of making them run their mode hook with `run-mode-hooks'. If we see one that does not, we fix it. In the meantime, if we use `after-change-mode-hook' in a very general way, we need some fallback for modes that do not yet use it. Sincerely, Luc.