I see that a few packages, and package.el use (file-name-directory #$). How does Emacs know what directory #$ is? On OSX, that returns Wrong type argument: stringp, nil.

Excerpt from cl-lib.el when installing a package evil-mc through the package manager, which goes into cl-lib-autoloads.el and then Emacs chokes:

;; First line of defense: try to make sure the built-in cl-lib comes earlier in
;; load-path so we never get loaded:
;;;###autoload (let ((d (file-name-directory #$)))
;;;###autoload   (when (member d load-path)
;;;###autoload     (setq load-path (append (remove d load-path) (list d)))))
share|improve this question
1  
Can you show an example of its use? – Drew Jun 26 at 3:46
    
@Drew -- Thanks, I updated the question with a specific example. As to package-autoload-ensure-default-file, I added (or (and #$ (file-name-directory #$)) ...) to avoid an error. But, I have no control over fixing the entry in cl-lib.el that the package manager is installing . . . . – lawlist Jun 26 at 3:52
up vote 6 down vote accepted

M-x elisp-index-search RET #$ RET tells us:

   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.

C-hig (elisp)Docs and Compilation

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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