From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Show who is requiring Date: Sat, 17 Nov 2012 12:11:09 +0200 Message-ID: <83fw4835fm.fsf@gnu.org> References: <80d2zd87t0.fsf@somewhere.org> <80haoo7eie.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1353147171 5379 80.91.229.3 (17 Nov 2012 10:12:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2012 10:12:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 17 11:13:02 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 1TZfOY-0006sP-5G for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Nov 2012 11:13:02 +0100 Original-Received: from localhost ([::1]:35111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZfON-0007zx-SO for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Nov 2012 05:12:51 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZfOF-0007zq-E0 for help-gnu-emacs@gnu.org; Sat, 17 Nov 2012 05:12:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZfOC-0006sA-Bw for help-gnu-emacs@gnu.org; Sat, 17 Nov 2012 05:12:43 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:37616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZfOC-0006s0-48 for help-gnu-emacs@gnu.org; Sat, 17 Nov 2012 05:12:40 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MDM00000MTP9K00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sat, 17 Nov 2012 12:11:38 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDM00MFFMZDUND0@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sat, 17 Nov 2012 12:11:38 +0200 (IST) In-reply-to: <80haoo7eie.fsf@somewhere.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 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:87744 Archived-At: > From: "Sebastien Vauban" > Date: Sat, 17 Nov 2012 10:41:29 +0100 > > I wasn't clear enough: what I'd like is that if, for example, helm-m-x.el contains > a require of helm.el, then (with my advice'd require), when requiring > helm-m-x, I'd see in the Messages: > > helm-m-x.el is now requiring helm.el > > So, I'm interested in the name of the package which contains require's of > other packages (and executes them). And I will repeat what I asked: doesn't "C-h f require" gives you that information? Let me put here what it shows, with suitably emphasized portions that should tell you what to do: (require FEATURE &optional FILENAME NOERROR) If feature FEATURE is not loaded, load it from FILENAME. If FEATURE is not a member of the list `features', then the feature is not loaded; so load the file FILENAME. ^^^^^^^^^^^^^^^^^^^^^^ If FILENAME is omitted, the printname of FEATURE is used as the file name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ and `load' will try to load this name appended with the suffix `.elc' or `.el', in that order. The name without appended suffix will not be used. See `get-load-suffixes' for the complete list of suffixes. If the optional third argument NOERROR is non-nil, then return nil if the file is not found instead of signaling an error. Normally the return value is FEATURE. The normal messages at start and end of loading FILENAME are suppressed. Since your defadvice has access to all the arguments of the call to 'require, you should be trivially able to see if FILENAME is specified, and if not, use something like (symbol-name FEATURE) to retrieve the file name. Am I missing something?