From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Dominik Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Wed, 25 May 2005 17:20:29 +0200 Message-ID: <17044.38845.200093.315541@sam.science.uva.nl> References: <87y8a3mnz8.fsf@xs4all.nl> <87ll63weye.fsf-monnier+emacs@gnu.org> Reply-To: Carsten Dominik NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1117035018 16428 80.91.229.2 (25 May 2005 15:30:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 May 2005 15:30:18 +0000 (UTC) Cc: Carsten Dominik , Lute Kamstra , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 25 17:30:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DaxnS-0002ao-E6 for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 17:27:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DaxrL-0008Ns-9b for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 11:31:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DaxnQ-0007Af-Rw for emacs-devel@gnu.org; Wed, 25 May 2005 11:27:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DaxnN-00076j-4Y for emacs-devel@gnu.org; Wed, 25 May 2005 11:27:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DaxnM-00073H-1f for emacs-devel@gnu.org; Wed, 25 May 2005 11:27:44 -0400 Original-Received: from [146.50.4.51] (helo=imap.science.uva.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Daxgo-0005sq-EC for emacs-devel@gnu.org; Wed, 25 May 2005 11:20:58 -0400 Original-Received: from sam.science.uva.nl [146.50.10.135] by imap.science.uva.nl with ESMTP (sendmail 8.11.6p2/config 11.35). id j4PFKTx32095; Wed, 25 May 2005 17:20:29 +0200 X-Organisation: Faculty of Science, University of Amsterdam, The Netherlands X-URL: http://www.science.uva.nl/ Original-Received: by sam.science.uva.nl (Postfix, from userid 11669) id 62BD717832; Wed, 25 May 2005 17:20:29 +0200 (CEST) Original-To: Stefan Monnier In-Reply-To: <87ll63weye.fsf-monnier+emacs@gnu.org> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Virus-Scanned: by amavisd-new 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:37618 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37618 I will change org-mode to use define-derived-mode. When I started writing this mode, some versions of define-derived-mode (maybe the one in XEmacs, I don't remember) did not allow a BODY argument. It seems they now all do, so I will modify org-mode. I don't really need the argument to org-mode. - Carsten >>>>> "SM" == Stefan Monnier writes: >> org-mode in lisp/textmodes/org.el is derived from outline-mode, but it >> doesn't use define-derived-mode to accomplish this. Instead, it just >> calls outline-mode as the first thing it does. (I guess this is >> because org-mode accepts an argument, which define-derived-mode >> doesn't support.) SM> define-derived-mode doesn't support it because the elisp manual says: SM> 23.1.1 Major Mode Conventions SM> ----------------------------- SM> [...] SM> * Define a command whose name ends in `-mode', with no arguments, SM> that switches to the new mode in the current buffer. This command SM> should set up the keymap, syntax table, and buffer-local variables SM> in an existing buffer, without changing the buffer's contents. SM> Why doesn't org-mode use auto-insert-mode to handle the insertion of SM> a template? I.e. just add the relevant template to auto-insert-alist and SM> let the users decide whether they want it or not by turning on SM> auto-insert-mode. >> The problem with this approach is that outline-mode's mode hook and >> after-change-major-mode-hook are run at the wrong time. What about the >> following patch to fix this? SM> While I think that org-mode should use define-derived-mode, I'm wondering SM> why it's a problem that after-change-major-mode-hook is run at the SM> wrong time. After all, such manual mode derivation (without using SM> define-derived-mode) is pretty common, so if there's a problem with it, we SM> should fix it. SM> Stefan -- Carsten Dominik \ _ / Sterrenkundig Instituut "Anton Pannekoek" |X| _ Kruislaan 403; NL-1098 SJ Amsterdam /| |\ _ _ _/ \ phone +31 (20) 525-7477; FAX +31 (20) 525-7484 __|o|___/ ~~ \___/ ~~~