From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Show who is requiring Date: Mon, 10 Dec 2012 20:57:43 -0500 Message-ID: References: <80d2zd87t0.fsf@somewhere.org> <804nkl7eqc.fsf@somewhere.org> <80zk1pv841.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1355191093 6592 80.91.229.3 (11 Dec 2012 01:58:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Dec 2012 01:58:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 11 02:58:27 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TiF72-000070-0I for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Dec 2012 02:58:24 +0100 Original-Received: from localhost ([::1]:39724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiF6p-000584-ER for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Dec 2012 20:58:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiF6j-00057m-1H for help-gnu-emacs@gnu.org; Mon, 10 Dec 2012 20:58:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiF6i-0004g3-0g for help-gnu-emacs@gnu.org; Mon, 10 Dec 2012 20:58:04 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:43470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiF6h-0004fr-QE for help-gnu-emacs@gnu.org; Mon, 10 Dec 2012 20:58:03 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TiF6q-0008Pz-A6 for help-gnu-emacs@gnu.org; Tue, 11 Dec 2012 02:58:12 +0100 Original-Received: from 108.161.115.152 ([108.161.115.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Dec 2012 02:58:12 +0100 Original-Received: from monnier by 108.161.115.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Dec 2012 02:58:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 108.161.115.152 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:gRR5EXZAvZcKyeBvp2arz2DWLtk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88125 Archived-At: > For some unknown reason (I mean: to me), `load-file-name' is sometimes nil, > like if the requires came out of nowhere: A require can happen when load-file-name is nil if that require is not at some top-level in a file, but is instead inside a function. > - vc-svn? For this one it's vc-find-backend-function in vc-hooks.el which loads VC backends on-demand. > Why isn't `load-file-name' set to `org.el' in this case, then? Because org.el has finished loading before org-load-modules-maybe is run. > - calendar requires cal-menu, and vice versa > - dired+ requires itself "Recursive" requires are not very common but do happen every once in a while. It's usually better to restructure your code to avoid them, but some authors don't want to bother (and the result is not always really better because the resulting structure is a result of details of implementation). At other times it's because some functions defined are used during compilation of the same file (e.g. they're used during macro-expansion). You can sometimes avoid self-requiring by using eval-and-compile instead (as does eieio.el, which uses eval-and-compile on a very large part of itself). Stefan