guile-devel
[Top][All Lists]
Advanced

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

Re: Trouble using (current-filename)


From: Ludovic Courtès
Subject: Re: Trouble using (current-filename)
Date: Fri, 17 Feb 2012 23:49:42 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux)

Hi,

Andy Wingo <address@hidden> skribis:

> On Thu 16 Feb 2012 22:34, address@hidden (Ludovic Courtès) writes:
>
>> Andy Wingo <address@hidden> skribis:
>>
>>>   (define-syntax current-filename
>>>     (lambda (x)
>>>       "A macro that expands to the current filename: the filename that
>>>   the (current-filename) form appears in.  Expands to #f if this
>>>   information is unavailable."
>>>       (false-if-exception
>>>        (pk 'canonicalized (canonicalize-path (pk 'filename (assq-ref 
>>> (syntax-source x) 'filename)))))))
>>
>> What about not canonicalizing the file name?
>
> That makes this recipe not work:
>
>      (add-to-load-path (dirname (current-filename)))
>
> I think the canonicalize-path was added after Neil's concerns about
> add-to-load-path.  We could take it out if that's the thing to do;
> dunno.

Would it work to let the user call it themself if needed, like:

  (add-to-load-path (dirname (canonicalize-path (current-filename))))

Thanks,
Ludo’.



reply via email to

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