bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Leo
Subject: bug#10946: 24.0.94; eval-after-load incompatible change
Date: Tue, 06 Mar 2012 00:16:17 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (Mac OS X 10.6.8)

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






reply via email to

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