From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: Get report on which files are loading Date: Sun, 18 May 2003 08:13:40 -0700 Organization: Still searching... Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1053271245 9997 80.91.224.249 (18 May 2003 15:20:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 18 May 2003 15:20:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sun May 18 17:20:41 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19HPxj-0002af-00 for ; Sun, 18 May 2003 17:20:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HPyk-0001PA-00 for gnu-help-gnu-emacs@m.gmane.org; Sun, 18 May 2003 11:21:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19HPyS-0001K5-00 for help-gnu-emacs@gnu.org; Sun, 18 May 2003 11:21:20 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19HPsV-00061Z-00 for help-gnu-emacs@gnu.org; Sun, 18 May 2003 11:15:16 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HPr8-0004ou-00 for help-gnu-emacs@gnu.org; Sun, 18 May 2003 11:13:46 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19HPpK-00027l-00 for ; Sun, 18 May 2003 17:11:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19HPpJ-00027b-00 for ; Sun, 18 May 2003 17:11:53 +0200 Original-Lines: 91 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:6uEHR0MUZ3jaxSF+M/sYW5mT0KM= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9853 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9853 Harry Putnam writes: > ;; make loaded files give a message [from Kai] > (defadvice load (before debug-log activate) > (message "(Tip from Kai G): Now loading: %s" (ad-get-arg 0))) > > It reports on some files but not on others. > For example it doesn't report when site-start.el is loaded even > though the defadvice is loaded first (from the command line) > emacs -l ~/whats_loading.el > > I have this in site-start.el to see when it loads: > (message "finished loading => /usr/local/share/emacs/site-lisp/site-start.el") (sit-for 1) > > I see in *Messages* buffer, stuff that indicate what is loading like this: [...] > I'd like to put something in that message line that allows emacs to > know what it has just read and from where. Something like the `%s' > operator in the defadvice. So that if for some reason site-start.el > is put somewhere else the accurate path and file name will still be > reported in *Messages* buffer. Something like: > (message "finished loading => SOMETHING TO REPORT PATH and FNAME") (sit-for 1) > > I couldn't get it right as to where to put the `%s' or if it will even > fit in this line of code. kai.grossjohann@gmx.net (Kai Großjohann) writes: > Harry Putnam writes: > >> (defadvice load (before debug-log activate) >> (message "(Tip from Kai G): Now loading: %s" (ad-get-arg 0))) > > Instead of (ad-get-arg 0), say (locate-library (ad-get-arg 0)). That > will give you the absolute filename. (defadvice load (before debug-log activate) (message "(Tip from Kai G): Now loading: %s" (locate-library (ad-get-arg 0)))) Well, that gives absolute file names alright but I think I must have confused the issue in my previous post. The defadvice DOES NOT report the loading of site-start.el even when the defadvice is preloaded from the command line with emacs -l whats_loading.el I don't understand why. But to compensate for that lack of report I put this at the end of site-start.el: (message "finished loading => /usr/local/share/emacs/site-lisp/site-start.el") (sit-for 1) What I wanted to know was how to change that line so I don't have to put the absolute filename manually. In other words. How to make the last `message' line above report absolute filename by itself (message "finished loading => "(SOMETHING HERE TO REPORT FILE NAME) (sit-for 1)) I want this because the defadvice DOES NOT report when site-start.el is loaded. Observe: emacs -l /usr/share/emacs/site-lisp/whats_loading.el & (`whats_loading.el' contains the defadvice as modified and shown above) Notice in the output of *Messages* that loading of site start el is NOT reported by the defadvice. The only indication is the message line shown above at the end of site-start.el: emacs -l /usr/local/share/emacs/site-lisp/whats_loading.el & *Messages*: Loading disp-table...done Loading encoded-kb...done Loading tool-bar...done Loading image...done Loading tooltip...done Loading whats_loading.el (source)... Loading advice...done Loading whats_loading.el (source)...done Loading help-fns...done (Tip from Kai G): Now loading: /home/reader/.emacs-custom Loading ~/.emacs-custom...done Loading skeleton...done Loading executable...done Loading regexp-opt...done finished loading => /usr/local/share/emacs/site-lisp/site-start.el (Tip from Kai G): Now loading: /home/reader/.emacs Loading bbdb-gnus... Loading easymenu...done [...]