From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Failing to advice `require' Date: Mon, 20 Aug 2012 17:30:23 +0200 Organization: Sebastien Vauban Message-ID: <80r4r18ttc.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345476913 671 80.91.229.3 (20 Aug 2012 15:35:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2012 15:35:13 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Mon Aug 20 17:35:14 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 1T3U0X-0003Hw-Mq for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Aug 2012 17:35:13 +0200 Original-Received: from localhost ([::1]:47825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3U0W-0003Bf-4s for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Aug 2012 11:35:12 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Injection-Info: mx04.eternal-september.org; posting-host="368fa3c7dc5c1bbe516391bd65bd1ab2"; logging-data="2151"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX194ZBwO3HgMVdm6SnNLBQ2d" User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (windows-nt) X-Url: Under construction... X-Archive: encrypt Cancel-Lock: sha1:zkNhNKODvGA5GFPDgR0QpbdpDSY= sha1:tBoByQOd78ER1KtdOgBbzOMTkIw= Original-Xref: usenet.stanford.edu gnu.emacs.help:194067 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.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-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:86434 Archived-At: Hello, I tried to advice the require function, in order to get: - performance information (load time) - call graph of `require' with the following code: --8<---------------cut here---------------start------------->8--- (defvar my/require-depth 0) (defadvice require (around require-around activate) "Leave a trace of packages being loaded." (let ((feature (ad-get-arg 0)) (filename (ad-get-arg 1)) (noerror (ad-get-arg 2)) (prefix (concat (make-string (* 2 my/require-depth) ? ) "+-> "))) (setq my/require-depth (1+ my/require-depth)) (cond ((featurep feature) (message "(info) %sRequiring `%s'... already loaded" prefix feature) ) (t (let ((my/time-start)) (message "(info) %sRequiring `%s'..." prefix feature) (setq my/time-start (float-time)) ad-do-it (message "(info) %sRequiring `%s'... %s (loaded in %.2f s)" prefix feature (locate-library (symbol-name feature)) (- (float-time) my/time-start)) ))) (setq my/require-depth (1- my/require-depth)))) --8<---------------cut here---------------end--------------->8--- It works quite well, except for the following case: --8<---------------cut here---------------start------------->8--- ;; Requiring `auth-source'... ;; (info) +-> Requiring `password-cache'... d:/home/sva/Downloads/emacs/site-lisp/gnus/lisp/password-cache.elc (loaded in 0.11 s) ;; (info) +-> Requiring `mm-util'... already loaded ;; (info) +-> Requiring `gnus-util'... already loaded ;; (info) +-> Requiring `eieio'... already loaded [2 times] ;; byte-code: eieio not found in `load-path' or gnus-fallback-lib/ directory. --8<---------------cut here---------------end--------------->8--- Guess what? `eieio' is in my default load path, in my GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600) of 2012-06-02 on MARVIN on Windows XP. Do you have any idea why it's failing? Best regards, Seb -- Sebastien Vauban