all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable
@ 2013-02-25 16:58 David Engster
  2013-02-25 20:53 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2013-02-25 16:58 UTC (permalink / raw)
  To: 13813

Recipe:

* Create a file test.el with the following contents:

(defvar myflag nil)

(defmacro mytestmacro ()
  "An eval-and-compile test."
  `(eval-and-compile (mytestfun)))

(defun mytestfun ()
  (when myflag
    (message "foo")))

(let ((myflag t))
  ;; Should display "foo"
  (mytestmacro))

* Now call with Emacs from trunk:

  emacs --batch -l test.el

* "foo" should be displayed, but isn't. The Emacs 24.2.93 pretest
  however works as expected.

* Note the following:

  - It works if you just 'setq' the 'myflag' variable

  - If you load the file interactively and call `eval-buffer', it will
    also output nothing. However, if you manually evaluate the last
    expression through C-x C-e, it will work.

  - The same problem occurs with `eval-when-compile', but everything
    works with `progn'.


Best,
David "who will never grasp eval-and-compile"

And yes, Stefan, this bug turned up in the EIEIO test suite. :-)





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-12  2:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25 16:58 bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable David Engster
2013-02-25 20:53 ` Stefan Monnier
2013-02-25 21:17   ` David Engster
2013-03-11 18:15     ` Stefan Monnier
2013-03-11 20:57       ` David Engster
2013-03-12  2:48         ` Stefan Monnier

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.