emacs-devel
[Top][All Lists]
Advanced

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

Re: relative load-file


From: Rocky Bernstein
Subject: Re: relative load-file
Date: Fri, 13 Nov 2009 10:06:06 -0500

Thanks for the info. Based on what the differences described, it looks like #$ is what I want to use.


On Fri, Nov 13, 2009 at 9:26 AM, Stefan Monnier <address@hidden> wrote:
> In fact I'd be curious to learn the differences between it
> and *load-file-name.*

The difference is the time at which the expansion takes place (either
read-time or eval-time).
E.g. try

   (defun foo () (interactive) (message "%s" #$))
and
   (defun foo () (interactive) (message "%s" load-file-name))

if you load a file containing one of the above lines and then you do
M-x foo RET you should see that the first returns the file name
(i.e. the value of load-file-name at the time the file was read) whereas
the other returns nil (the value of load-file-name at the time you
called `foo').


       Stefan


reply via email to

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