diff options
| author | Richard M. Stallman | 1996-03-05 04:22:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-03-05 04:22:44 +0000 |
| commit | ed2f7fc80bd67fce14197537a0ff89a778831e20 (patch) | |
| tree | 399d9df710974b07674a12a370d0a2b821b26c09 | |
| parent | 52b9a93170c1540d45c60ceeaff468fcfc5a1744 (diff) | |
| download | emacs-ed2f7fc80bd67fce14197537a0ff89a778831e20.tar.gz emacs-ed2f7fc80bd67fce14197537a0ff89a778831e20.zip | |
(desktop-list*): New function.
(desktop-internal-v2s): Generate output using desktop-list*.
| -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.") | |||
| 217 | nil | 217 | nil |
| 218 | (signal (car err) (cdr err))))))) | 218 | (signal (car err) (cdr err))))))) |
| 219 | ;; ---------------------------------------------------------------------------- | 219 | ;; ---------------------------------------------------------------------------- |
| 220 | (defun desktop-list* (&rest args) | ||
| 221 | (if (null (cdr args)) | ||
| 222 | (car args) | ||
| 223 | (setq args (nreverse args)) | ||
| 224 | (let ((value (cons (nth 1 args) (car args)))) | ||
| 225 | (setq args (cdr (cdr args))) | ||
| 226 | (while args | ||
| 227 | (setq value (cons (car args) value)) | ||
| 228 | (setq args (cdr args))) | ||
| 229 | value))) | ||
| 230 | |||
| 220 | (defun desktop-internal-v2s (val) | 231 | (defun desktop-internal-v2s (val) |
| 221 | "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. | 232 | "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. |
| 222 | TXT is a string that when read and evaluated yields value. | 233 | TXT is a string that when read and evaluated yields value. |
| @@ -254,6 +265,7 @@ QUOTE may be `may' (value may be quoted), | |||
| 254 | ((consp val) | 265 | ((consp val) |
| 255 | (let ((p val) | 266 | (let ((p val) |
| 256 | newlist | 267 | newlist |
| 268 | use-list* | ||
| 257 | anynil) | 269 | anynil) |
| 258 | (while (consp p) | 270 | (while (consp p) |
| 259 | (let ((q.txt (desktop-internal-v2s (car p)))) | 271 | (let ((q.txt (desktop-internal-v2s (car p)))) |
| @@ -263,22 +275,15 @@ QUOTE may be `may' (value may be quoted), | |||
| 263 | (if p | 275 | (if p |
| 264 | (let ((last (desktop-internal-v2s p)) | 276 | (let ((last (desktop-internal-v2s p)) |
| 265 | (el (car newlist))) | 277 | (el (car newlist))) |
| 266 | (setcar newlist | 278 | (or anynil (setq anynil (null (car last)))) |
| 267 | (if (or anynil (setq anynil (null (car last)))) | 279 | (or anynil |
| 268 | (cons nil | 280 | (setq newlist (cons '(must . ".") newlist))) |
| 269 | (concat "(cons " | 281 | (setq use-list* t) |
| 270 | (if (eq (car el) 'must) "'" "") | 282 | (setq newlist (cons last newlist)))) |
| 271 | (cdr el) | ||
| 272 | " " | ||
| 273 | (if (eq (car last) 'must) "'" "") | ||
| 274 | (cdr last) | ||
| 275 | ")")) | ||
| 276 | (cons 'must | ||
| 277 | (concat (cdr el) " . " (cdr last))))))) | ||
| 278 | (setq newlist (nreverse newlist)) | 283 | (setq newlist (nreverse newlist)) |
| 279 | (if anynil | 284 | (if anynil |
| 280 | (cons nil | 285 | (cons nil |
| 281 | (concat "(list " | 286 | (concat (if use-list* "(desktop-list* " "(list ") |
| 282 | (mapconcat (lambda (el) | 287 | (mapconcat (lambda (el) |
| 283 | (if (eq (car el) 'must) | 288 | (if (eq (car el) 'must) |
| 284 | (concat "'" (cdr el)) | 289 | (concat "'" (cdr el)) |