Subject: bug#24576: 25.1; desktop.el does not fully preserve registers with macros

From: Dmitri Paduchikh <[email-masked]>
Date: Wed, 29 May 2019 22:41:58 +0500

Noam Postavsky <[email-masked]> wrote:

>>> The "unprintable entity" comes from desktop--v2s, looks like it doesn't
>>> handle compiled function values, so that's why :print-func and
>>> :insert-func get messed up like that.

NP> I note that the functions in question come from this code in kmacro.el:

NP> (defun kmacro-to-register (r)
NP>   ... (registerv-make
NP>                    last-kbd-macro
NP>                    :jump-func 'kmacro-execute-from-register
NP>                    :print-func (lambda (k)
NP>                                  (princ (format "a keyboard macro:\n   %s"
NP>                                                 (format-kbd-macro k))))
NP>                    :insert-func (lambda (k)
NP>                                   (insert (format-kbd-macro k))))

This must be easy to fix. Just defun these anonymous functions and use their
names in place of lambdas. Or any newer approach, of course.

All the best.
Dmitri Paduchikh