Subject: Re: bug#40375: 27.0.50; yank unexpectedly depends on progn

From: Markus Triska <[email-masked]>
Date: Wed, 01 Apr 2020 19:53:43 +0200

Noam Postavsky <[email-masked]> writes:

> prints "hello".  The problem is the first case erases the code which
> calls message before it is read in.

OK, here is a better test case. Let yank.el consist of the single form:

   (let ((data (base64-decode-string
   "iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbBAMAAAC+faPKAAAALVBMVEX///8AAACgoKDg4OBAQEDA
   wMAQEBCQkJAgICCAgIBwcHAwMDBgYGDQ0NDw8PALucPOAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA
   X0lEQVQIHWNgYGBQBmIQcIVQDKkQmlkUQrNDaQ4oPRFCswuCaatGQWkXFwcGy5mNMjNnTgBqcYSq
   o4Q2gpoTgoVeKMTAUAUUvygDcTKXYACTA5DPoCG95QGIZjC9wAAAJ0UR8BmY4ewAAAAASUVORK5C
   YII=")))
     (kill-new
      (propertize data 'display `(image :type png :data ,data :ascent center))))

When I start Emacs with:

    $ emacs -Q yank.el --eval='(eval-buffer)'

and then press C-y to yank, the image that was most recently killed via
kill-new is unexpectedly not inserted. However, when I invoke Emacs
with the form wrapped in (progn ...), followed by (yank), i.e. with:

    $ emacs -Q yank.el --eval='(progn (eval-buffer) (yank))'

then the image is indeed inserted.

Why is there this difference? Thank you a lot for looking into this!

All the best,
Markus