Subject: Re: bug#35131: 27.0.50; desktop-save no longer saves register containing frameset
From: Stefan Monnier <[email-masked]>
To: Tadeus Prastowo <[email-masked]>
Cc: [email-masked]
Date: Thu, 04 Apr 2019 13:48:16 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Tadeus Prastowo <[email-masked]> writes:
> $ emacs -Q
> C-x C-f x.txt
> Hello world!
> C-x C-s
> C-x 3
> C-x 2
> C-x r f =
> C-x 1
> M-x desktop-save RET RET yes RET
> C-x C-c
> $ emacs -Q
> M-x desktop-read RET
> C-x r j =
> The echo area says: Register doesn’t contain a buffer position or configuration

Thanks for the straightforward testcase.
I installed the patch below which seems to fix it,

        Stefan

diff --git a/lisp/desktop.el b/lisp/desktop.el
index acabde5eb2..97c057e201 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -856,6 +856,19 @@ desktop--v2s
                                        `',(cdr el) (cdr el)))
                                  pass1)))
 	 (cons 'may `[,@(mapcar #'cdr pass1)]))))
+    ((and (recordp value) (symbolp (aref value 0)))
+     (let* ((pass1 (let ((res ()))
+                     (dotimes (i (length value))
+                       (push (desktop--v2s (aref value i)) res))
+                     (nreverse res)))
+	    (special (assq nil pass1)))
+       (if special
+	   (cons nil `(record
+                       ,@(mapcar (lambda (el)
+                                   (if (eq (car el) 'must)
+                                       `',(cdr el) (cdr el)))
+                                 pass1)))
+	 (cons 'may (apply #'record (mapcar #'cdr pass1))))))
     ((consp value)
      (let ((p value)
 	   newlist