changeset 58180:fa5bfbfb3478

(desktop-create-buffer, desktop-save): Avoid some consing by using mapc instead of mapcar.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 12 Nov 2004 16:54:30 +0000
parents b811024a0534
children 6f6fadd54910
files lisp/desktop.el
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/desktop.el	Fri Nov 12 16:11:11 2004 +0000
+++ b/lisp/desktop.el	Fri Nov 12 16:54:30 2004 +0000
@@ -636,7 +636,7 @@
         ";; Desktop file format version " desktop-file-version "\n"
         ";; Emacs version " emacs-version "\n\n"
         ";; Global section:\n")
-      (mapcar (function desktop-outvar) desktop-globals-to-save)
+      (mapc (function desktop-outvar) desktop-globals-to-save)
       (if (memq 'kill-ring desktop-globals-to-save)
         (insert
           "(setq kill-ring-yank-pointer (nthcdr "
@@ -644,15 +644,15 @@
           " kill-ring))\n"))
 
       (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
-      (mapcar #'(lambda (l)
-                  (if (apply 'desktop-save-buffer-p l)
-                      (progn
-                        (insert "(desktop-create-buffer " desktop-file-version)
-                        (mapcar #'(lambda (e)
-                                    (insert "\n  " (desktop-value-to-string e)))
-                                l)
-                        (insert ")\n\n"))))
-              info)
+      (mapc #'(lambda (l)
+		(if (apply 'desktop-save-buffer-p l)
+		    (progn
+		      (insert "(desktop-create-buffer " desktop-file-version)
+		      (mapc #'(lambda (e)
+				(insert "\n  " (desktop-value-to-string e)))
+			    l)
+		      (insert ")\n\n"))))
+	    info)
       (setq default-directory dirname)
       (when (file-exists-p filename) (delete-file filename))
       (let ((coding-system-for-write 'emacs-mule))
@@ -873,9 +873,9 @@
               ((equal '(nil) desktop-buffer-minor-modes) ; backwards compatible
                (auto-fill-mode 0))
               (t
-               (mapcar #'(lambda (minor-mode)
-                           (when (functionp minor-mode) (funcall minor-mode 1)))
-                       desktop-buffer-minor-modes)))
+               (mapc #'(lambda (minor-mode)
+			 (when (functionp minor-mode) (funcall minor-mode 1)))
+		     desktop-buffer-minor-modes)))
         ;; Even though point and mark are non-nil when written by `desktop-save'
         ;; they may be modified by handlers wanting to set point or mark themselves.
         (when desktop-buffer-point