From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.gnus.general,gmane.emacs.devel Subject: Re: require inside functions. (was: Changes in Date: Fri, 08 Apr 2005 23:38:33 -0400 Message-ID: References: <871x9w9dkn.fsf@xs4all.nl> <87mzsezu5f.fsf@xs4all.nl> <87hdimzou0.fsf@xs4all.nl> <87ll7uwy6m.fsf_-_@xs4all.nl> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1113017886 29695 80.91.229.2 (9 Apr 2005 03:38:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Apr 2005 03:38:06 +0000 (UTC) Cc: Lute.Kamstra.lists@xs4all.nl, reiner.steib@gmx.de, ding@gnus.org, emacs-devel@gnu.org, snogglethorpe@gmail.com, miles@gnu.org Original-X-From: ding-owner+M8658@lists.math.uh.edu Sat Apr 09 05:38:02 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DK6nH-0000CN-Ux for ding-account@gmane.org; Sat, 09 Apr 2005 05:38:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1DK6oV-0004OG-00; Fri, 08 Apr 2005 22:39:15 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DK6oO-0004OA-00 for ding@lists.math.uh.edu; Fri, 08 Apr 2005 22:39:08 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DK6oM-0007fa-7I for ding@lists.math.uh.edu; Fri, 08 Apr 2005 22:39:06 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1DK6oL-0000bd-00 for ; Sat, 09 Apr 2005 05:39:05 +0200 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DK6np-0007T4-9p; Fri, 08 Apr 2005 23:38:33 -0400 Original-To: storm@cua.dk (Kim F. Storm) In-reply-to: (storm@cua.dk) X-Spam-Score: -4.8 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60131 gmane.emacs.devel:35787 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35787 It is not _file_ foo, but _function_ foo that did (require 'bar). Why is it useful to record that? For what purpose? It isn't particularly useful, but it is hard to avoid. Frequire does the same things, whether `require' was called from a Lisp function or from code at top level in a file. However, my change turns off recording in the case where no file is being loaded. Does this give good results? *** fns.c 18 Jan 2005 19:52:01 -0500 1.382 --- fns.c 08 Apr 2005 22:22:22 -0400 *************** *** 66,71 **** --- 66,72 ---- extern int minibuffer_auto_raise; extern Lisp_Object minibuf_window; extern Lisp_Object Vlocale_coding_system; + extern Lisp_Object Vloads_in_progress; Lisp_Object Qstring_lessp, Qprovide, Qrequire; Lisp_Object Qyes_or_no_p_history; *************** *** 3444,3452 **** CHECK_SYMBOL (feature); /* Record the presence of `require' in this file ! even if the feature specified is already loaded. */ ! LOADHIST_ATTACH (Fcons (Qrequire, feature)); ! tem = Fmemq (feature, Vfeatures); if (NILP (tem)) --- 3445,3459 ---- CHECK_SYMBOL (feature); /* Record the presence of `require' in this file ! even if the feature specified is already loaded. ! But not more than once in any file, ! and not when we aren't loading a file. */ ! if (! NILP (Vloads_in_progress)) ! { ! tem = Fcons (Qrequire, feature); ! if (NILP (Fmember (tem, Vcurrent_load_list))) ! LOADHIST_ATTACH (tem); ! } tem = Fmemq (feature, Vfeatures); if (NILP (tem))