help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Show who is requiring


From: Eli Zaretskii
Subject: Re: Show who is requiring
Date: Sat, 17 Nov 2012 12:11:09 +0200

> From: "Sebastien Vauban" <address@hidden>
> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]