emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 81f64da: * lisp/desktop.el (desktop--v2s): Add case


From: Stefan Monnier
Subject: [Emacs-diffs] master 81f64da: * lisp/desktop.el (desktop--v2s): Add case for defstructs (bug#35131)
Date: Thu, 4 Apr 2019 13:46:45 -0400 (EDT)

branch: master
commit 81f64da220b7a8b46f64212724cb2be6c99a0cac
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/desktop.el (desktop--v2s): Add case for defstructs (bug#35131)
---
 lisp/desktop.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lisp/desktop.el b/lisp/desktop.el
index acabde5..97c057e 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -856,6 +856,19 @@ QUOTE may be `may' (value may be quoted),
                                        `',(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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]