From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: lisp/generic.el patch. Date: Tue, 15 Mar 2005 22:47:11 +0100 Message-ID: <87hdjc7fa8.fsf@xs4all.nl> References: <87y8co96uz.fsf@xs4all.nl> <877jk8oi9s.fsf-monnier+emacs@gnu.org> <87vf7s7jcp.fsf@xs4all.nl> <87y8colji9.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110923895 5433 80.91.229.2 (15 Mar 2005 21:58:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2005 21:58:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 15 22:58:14 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DBJx5-0000IU-UQ for ged-emacs-devel@m.gmane.org; Tue, 15 Mar 2005 22:51:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBKD3-0007xW-DC for ged-emacs-devel@m.gmane.org; Tue, 15 Mar 2005 17:08:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DBK8X-0006g0-BK for emacs-devel@gnu.org; Tue, 15 Mar 2005 17:03:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DBK8P-0006b3-8E for emacs-devel@gnu.org; Tue, 15 Mar 2005 17:03:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBK8M-0006aO-1P for emacs-devel@gnu.org; Tue, 15 Mar 2005 17:03:26 -0500 Original-Received: from [194.109.24.27] (helo=smtp-vbr7.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DBJse-0003wh-DA for emacs-devel@gnu.org; Tue, 15 Mar 2005 16:47:12 -0500 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr7.xs4all.nl (8.12.11/8.12.11) with ESMTP id j2FLlBoG016719; Tue, 15 Mar 2005 22:47:11 +0100 (CET) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1DBJsd-00049L-00; Tue, 15 Mar 2005 22:47:11 +0100 Original-To: Stefan Monnier In-Reply-To: <87y8colji9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 15 Mar 2005 15:52:40 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 29 X-Virus-Scanned: by XS4ALL Virus Scanner 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34620 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34620 Stefan Monnier writes: >>> When loading a byte-compiled file that used define-generic-mode, I >>> think you'll get an error that generic-mode-list is not defined >>> (because generic.el doesn't get loaded: the autoload caused >>> generic.el to be loaded during byte-compilation, but it doesn't >>> have any such effect when loading the macro-expanded code). > >> Good point. The same goes for calling generic-mode-internal. I'll >> add autoload cookies to generic-mode-list and generic-mode-internal. > > Maybe a better choice is to put a (require 'generic) in the macro > expanded code. I thought about that. The difference is that adding (require 'generic) causes generic.el to be loaded the moment a file with a compiled define-generic-mode call gets loaded. Using autoload cookies delays loading generic.el until the generic-mode function is actually called. I prefer the latter. Maybe the mode function will never be called. For example, it makes it possible to remove (require 'generic) from generic-x.el. So you can just load generic-x.elc to define a bunch of major modes (and add them to auto-mode-alist) and generic.el will only be loaded when you actually use one of them. Why do you prefer adding (require 'generic)? Lute.