[Top][All Lists]

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

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

From: Stefan Monnier
Subject: bug#10946: 24.0.94; eval-after-load incompatible change
Date: Mon, 05 Mar 2012 16:33:33 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

>> 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.

Wouldn't a better fix be to make Pymacs set load-file-name, then?


reply via email to

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