all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `pp-eval-expression' behaves strangely under lexical binding
@ 2016-04-17 13:43 Marcin Borkowski
  2016-04-17 14:33 ` Marcin Borkowski
  0 siblings, 1 reply; 6+ messages in thread
From: Marcin Borkowski @ 2016-04-17 13:43 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

put this in an empty buffer, call `normal-mode' (so that
`lexical-binding' is set to t) and evaluate:

--8<---------------cut here---------------start------------->8---
;;; -*- lexical-binding: t; -*-
(setq spam 'eggs)
(let ((spam 'bacon))
  (pp-eval-expression 'spam)
  (message "%s" spam))
--8<---------------cut here---------------end--------------->8---

Then look at *Messages*: "eggs" is printed, then "bacon".

I wanted to use `pp-eval-expression' when debugging (basically as
a pretty-printing variant of `message'), and this behavior hit me.  Why
does this behave in this way, and is it a feature or a bug?

Best

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



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

end of thread, other threads:[~2016-04-18 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-17 13:43 `pp-eval-expression' behaves strangely under lexical binding Marcin Borkowski
2016-04-17 14:33 ` Marcin Borkowski
2016-04-17 16:15   ` Stefan Monnier
2016-04-17 17:42     ` Marcin Borkowski
2016-04-18 15:07     ` Andy Moreton
2016-04-18 15:58       ` 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.