all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: 10946@debbugs.gnu.org
Subject: bug#10946: 24.0.94; eval-after-load incompatible change
Date: Tue, 06 Mar 2012 00:16:17 +0800	[thread overview]
Message-ID: <m1k42zdnvy.fsf@gmail.com> (raw)
In-Reply-To: <m1k42ziacs.fsf@gmail.com>

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	other threads:[~2012-03-05 16:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 10:57 bug#10946: 24.0.94; eval-after-load incompatible change Leo
2012-03-05 15:05 ` Stefan Monnier
2012-03-05 16:16   ` Leo [this message]
2012-03-05 21:33     ` Stefan Monnier
2012-03-06 15:29       ` Leo
2012-03-06 20:57         ` Stefan Monnier
2012-03-06 23:49           ` Leo
2012-03-07 17:06             ` Stefan Monnier
2012-03-07 20:28               ` Stefan Monnier
2012-03-08  3:21                 ` Leo
2012-03-09 18:14                 ` Glenn Morris
2012-03-10  2:40                   ` Stefan Monnier
2012-03-16  1:29                     ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1k42zdnvy.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=10946@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.