all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Mauger <michael@mauger.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Expansion of #$ in byte-compiled files
Date: Thu, 3 Sep 2015 19:53:27 +0000 (UTC)	[thread overview]
Message-ID: <1668732705.1162011.1441310007202.JavaMail.yahoo@mail.yahoo.com> (raw)

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.

This is with the latest Cygwin version with the W32 GUI:

  GNU Emacs 24.5.1 (x86_64-unknown-cygwin)
   of 2015-06-23 on desktop-new

Are others seeing the issue? Is this cygwin specific?  I will try this out on a Linux latest dev version as soon as I can.



             reply	other threads:[~2015-09-03 19:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 19:53 Michael Mauger [this message]
2015-09-03 21:14 ` Expansion of #$ in byte-compiled files Ken Brown
2015-09-03 21:51 ` Kalle Olavi Niemitalo
2015-09-04  1:46   ` Michael Mauger
2015-09-04 14:49     ` Ken Brown
2015-09-04  2:12 ` Stefan Monnier

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=1668732705.1162011.1441310007202.JavaMail.yahoo@mail.yahoo.com \
    --to=michael@mauger.com \
    --cc=emacs-devel@gnu.org \
    /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.