I see Emacs use #$ in autoload files, but I don't known if there are any difference between #$ and load-file-name. When I use them in a file, they looks like the same and when I print them by M-: they are both nil. So I did some test but only get more confused. Does #$ behave more like __FILE__ in Python?


Ask Emacs.

M-x elisp-index-search RET #$ RET

Internally, the dynamic loading of documentation strings is accomplished by writing compiled files with a special Lisp reader construct, ‘#@COUNT’. This construct skips the next COUNT characters. It also uses the ‘#$’ construct, which stands for “the name of this file, as a string”. Do not use these constructs in Lisp source files; they are not designed to be clear to humans reading the file.

| improve this answer | |
  • Note that you can do that kind of search when inside an info document by using C-s, entering the term and hitting C-s repeatedly. – wasamasa May 1 '16 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.