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: Strange code in derived.el. Date: Thu, 09 Jun 2005 12:14:09 -0400 Message-ID: References: <87u0k7jz7k.fsf@xs4all.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118334818 13129 80.91.229.2 (9 Jun 2005 16:33:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Jun 2005 16:33:38 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 09 18:33:27 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DgPxw-0000Bg-Gb for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 18:33:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgQ4t-0008RU-IO for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 12:40:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DgQ32-0007kI-Ub for emacs-devel@gnu.org; Thu, 09 Jun 2005 12:38:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DgQ32-0007jv-DU for emacs-devel@gnu.org; Thu, 09 Jun 2005 12:38:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgQ14-0006oS-JR for emacs-devel@gnu.org; Thu, 09 Jun 2005 12:36:26 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DgPfk-0002lX-ES for emacs-devel@gnu.org; Thu, 09 Jun 2005 12:14:24 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id ABFB32CF4B5; Thu, 9 Jun 2005 12:14:12 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 794CC4AC008; Thu, 9 Jun 2005 12:14:09 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 644F3E6C17; Thu, 9 Jun 2005 12:14:09 -0400 (EDT) Original-To: Lute Kamstra In-Reply-To: <87u0k7jz7k.fsf@xs4all.nl> (Lute Kamstra's message of "Thu, 09 Jun 2005 18:02:07 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.844, requis 5, autolearn=not spam, AWL 0.06, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca 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:38453 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38453 > I don't understand this piece of code at the end of > define-derived-mode in lisp/emacs-lisp/derived.el: > ,---- > | ;; Run the hooks, if any. > | ;; Make the generated code work in older Emacs versions > | ;; that do not yet have run-mode-hooks. > | (if (fboundp 'run-mode-hooks) > | (run-mode-hooks ',hook) > | (run-hooks ',hook)))))) > `---- > Is the expansion of this define-derive-mode macro ever run in older > Emacsen? Hopefully not. Such forward compatibility on .elc files is generally not guaranteed. > Wouldn't delay-mode-hooks (used unconditionally) be missing as well, then? No: it's a macro so it'll be expanded away. > Shall I just delete the test? I'd say yes, but since someone went to the trouble of adding it (I didn't write it in the original code) maybe this someone can explain why she found it to be necessary/useful. Stefan