emacs-devel
[Top][All Lists]
Advanced

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

How to get recursive load level?


From: Michael Heerdegen
Subject: How to get recursive load level?
Date: Sat, 14 Sep 2013 23:19:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hello,

I want to show a tree of recently loaded elisp files in a log buffer.
The tree structure should show which file was loaded by another one.
For this purpose, it is sufficient to know the recursive load level of
each file (and the loading order, which is trivial).  Is there any mean
to get that information more or less directly?

I have a working, but ugly solution: to `after-load-functions' I add a
function like

(lambda (file)
  (push (cons load-file-name file) temp-load-hist))

When the hook is run, `file' is bound to the file that was loaded, and
`load-file-name' to the file that loaded it, or nil when it was loaded
directly.  Afterwards, I scan `temp-load-hist' and reconstruct the load
tree.  This is very fragile - can it be done better?  Please also
answer when you think "no".

Second question: is there a mean to run a function directly before a
file is loaded?  I don't want to advice `load', and there is no hook.
Because I would want to write

  Loading ...

rather than afterwards

  Loaded ...

in my log buffer.


Thanks,

Michael.




reply via email to

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