diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-03-05 04:22:44 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-03-05 04:22:44 +0000 |
commit | ed2f7fc80bd67fce14197537a0ff89a778831e20 (patch) | |
tree | 399d9df710974b07674a12a370d0a2b821b26c09 /lisp/desktop.el | |
parent | 52b9a93170c1540d45c60ceeaff468fcfc5a1744 (diff) | |
download | emacs-ed2f7fc80bd67fce14197537a0ff89a778831e20.tar.gz |
(desktop-list*): New function.
(desktop-internal-v2s): Generate output using desktop-list*.
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r-- | lisp/desktop.el | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el index 12dd8c3a03a..e60cab8bce8 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -217,6 +217,17 @@ the like shorter.") nil (signal (car err) (cdr err))))))) ;; ---------------------------------------------------------------------------- +(defun desktop-list* (&rest args) + (if (null (cdr args)) + (car args) + (setq args (nreverse args)) + (let ((value (cons (nth 1 args) (car args)))) + (setq args (cdr (cdr args))) + (while args + (setq value (cons (car args) value)) + (setq args (cdr args))) + value))) + (defun desktop-internal-v2s (val) "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. TXT is a string that when read and evaluated yields value. @@ -254,6 +265,7 @@ QUOTE may be `may' (value may be quoted), ((consp val) (let ((p val) newlist + use-list* anynil) (while (consp p) (let ((q.txt (desktop-internal-v2s (car p)))) @@ -263,22 +275,15 @@ QUOTE may be `may' (value may be quoted), (if p (let ((last (desktop-internal-v2s p)) (el (car newlist))) - (setcar newlist - (if (or anynil (setq anynil (null (car last)))) - (cons nil - (concat "(cons " - (if (eq (car el) 'must) "'" "") - (cdr el) - " " - (if (eq (car last) 'must) "'" "") - (cdr last) - ")")) - (cons 'must - (concat (cdr el) " . " (cdr last))))))) + (or anynil (setq anynil (null (car last)))) + (or anynil + (setq newlist (cons '(must . ".") newlist))) + (setq use-list* t) + (setq newlist (cons last newlist)))) (setq newlist (nreverse newlist)) (if anynil (cons nil - (concat "(list " + (concat (if use-list* "(desktop-list* " "(list ") (mapconcat (lambda (el) (if (eq (car el) 'must) (concat "'" (cdr el)) |