emacs-devel
[Top][All Lists]
Advanced

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

Re: Expansion of #$ in byte-compiled files


From: Ken Brown
Subject: Re: Expansion of #$ in byte-compiled files
Date: Thu, 3 Sep 2015 17:14:46 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 9/3/2015 3:53 PM, Michael Mauger wrote:
Please correct me if I am not right here, but it appears that in byte-compiled 
files (don't always?) expand #$ to the current elisp file name.

I wrote a module containing the following code:

   (message "x: %S" #$)

When I load this module using load-file of the .el file adds a line to the 
*Message* buffer

   Loading /user/michael/x.el (source)...

   x: "/user/michael/x.el"
   Loading /user/michael/x.el (source)...done


I then byte-compile the module, use load-file on the .elc file, and now I get


   Loading /user/michael/x.elc...
   x: nil
   Loading /user/michael/x.elc...done


This causes all loading ELPA/MELPA packages to generate the following error 
during initialization:

   (wrong-type-argument stringp nil)

because of the following generated line in the package autoloads script:

   (add-to-list 'load-path (or (file-name-directory #$) (car load-path)))

and then the autoloads file gets byte-compile'd when installed.

Why does the autoloads file get byte-compiled? All the package autoloads files on my system have the following in the "Local Variables" section:

   ;; no-byte-compile: t

Ken




reply via email to

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