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

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

Re: Simple lisp question - printing out file name


From: Pascal Bourguignon
Subject: Re: Simple lisp question - printing out file name
Date: Tue, 10 Jan 2006 21:15:59 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

exits funnel <exitsfunnel@yahoo.com> writes:

> Hello,
>
> I have added to several .el files something like this:
>
> (message "In prj.el")
>
> to help me straighten out configuration issues.  I'd
> like to make it slightly more sophisicated by (a)
> replacing the hard coded string with some lisp to read
> the fully qualified file name and (b) to prepend a
> timestamp.  I'm sure this is trivial lisp, but
> apparently it's not quite trivial enough for me :)  It
> seems that buffer-file-name and current-time-string
> should be of interest to me but I can't get them to
> work inside my message call.  Can anyone help me out
> here?  Thanks in advance.

(message (format "On %s loading %s" (time-stamp-string) load-file-name))

You can also specify the time-stamp-format:

   (time-stamp-string "%:y-%02m-%02d %02H:%02M:%02S")



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

CAUTION: The mass of this product contains the energy equivalent of
85 million tons of TNT per net ounce of weight.


reply via email to

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