all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Harry Putnam <reader@newsguy.com>
Subject: Re: Get report on which files are loading
Date: Sun, 18 May 2003 08:13:40 -0700	[thread overview]
Message-ID: <m3r86wwamz.fsf@sbcglobal.net> (raw)
In-Reply-To: m3wugp3x2n.fsf@sbcglobal.net

Harry Putnam <reader@newsguy.com> 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 <reader@newsguy.com> 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
[...]

  reply	other threads:[~2003-05-18 15:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-18  0:41 Get report on which files are loading Harry Putnam
2003-05-18 15:13 ` Harry Putnam [this message]
     [not found] ` <mailman.6356.1053271291.21513.help-gnu-emacs@gnu.org>
2003-05-18 15:45   ` Kai Großjohann
2003-05-18 22:14     ` Harry Putnam
2003-05-18 18:09   ` Stefan Monnier
2003-05-18 22:14     ` Harry Putnam
2003-05-18 23:36       ` Stefan Monnier
2003-05-19  5:13         ` Harry Putnam
2003-05-19 13:51         ` Stefan Monnier
2003-05-19 14:39           ` Harry Putnam
2003-05-19 19:16   ` Kevin Rodgers
2003-05-19 23:32     ` Harry Putnam
     [not found] <mailman.6352.1053220313.21513.help-gnu-emacs@gnu.org>
2003-05-18  8:33 ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3r86wwamz.fsf@sbcglobal.net \
    --to=reader@newsguy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.