[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`pp-eval-expression' behaves strangely under lexical binding
From: |
Marcin Borkowski |
Subject: |
`pp-eval-expression' behaves strangely under lexical binding |
Date: |
Sun, 17 Apr 2016 15:43:55 +0200 |
User-agent: |
mu4e 0.9.13; emacs 25.1.50.8 |
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
- `pp-eval-expression' behaves strangely under lexical binding,
Marcin Borkowski <=