Subject: bug#10946: 24.0.94; eval-after-load incompatible change

From: Leo <[email-masked]>
Date: Tue, 06 Mar 2012 00:16:17 +0800

On 2012-03-05 23:05 +0800, Stefan Monnier wrote:
> Can you provide some details about how/why there's no load-file-name
> (which I guess just means it's nil).

See: https://github.com/pinard/Pymacs

`pymacs-load' loads python module and creates elisp functions that call
those python functions.

(defun pymacs-load (module &optional prefix noerror)
  (interactive
   (let* ((module (read-string "Python module? "))
          (default (concat (car (last (split-string module "\\."))) "-"))
          (prefix (read-string (format "Prefix? [%s] " default)
                               nil nil default)))
     (list module prefix)))
  (message "Pymacs loading %s..." module)
  (let ((lisp-code (pymacs-call "pymacs_load_helper" module prefix)))
    (cond (lisp-code (let ((result (eval lisp-code)))
                       (message "Pymacs loading %s...done" module)
                       result))
          (noerror (message "Pymacs loading %s...failed" module) nil)
          (t (pymacs-report-error "Pymacs loading %s...failed" module)))))

It uses eval so no load-file-name is defined, i.e. if lisp-code contains
a form (provide 'whatever), it no longer eval the matching form in
after-load-alist.

Leo