]> git.eshelyaron.com Git - emacs.git/commitdiff
(bookmark-write-file): Avoid calling `pp' with large
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 20 Sep 2009 14:54:17 +0000 (14:54 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 20 Sep 2009 14:54:17 +0000 (14:54 +0000)
list, to workaround performance problem (bug#4485).

lisp/ChangeLog
lisp/bookmark.el

index 40362f6d39c37690edad3e32823e14bb7815fb7b..16eea2af93eb08172c9f316d22e76362ec2b3124 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-20  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
+
+       * bookmark.el (bookmark-write-file): Avoid calling `pp' with large
+       list, to workaround performance problem (bug#4485).
+
 2009-09-20  Nick Roberts  <nickrob@snap.net.nz>
 
        * progmodes/gud.el (gud-sentinel): Revert indavertant change.
@@ -17,8 +22,8 @@
 
 2009-09-19  Chong Yidong  <cyd@stupidchicken.com>
 
-       * emacs-lisp/advice.el (ad-get-argument, ad-set-argument): Doc
-       fix (Bug#3932).
+       * emacs-lisp/advice.el (ad-get-argument, ad-set-argument):
+       Doc fix (Bug#3932).
 
        * subr.el (baud-rate): Remove long-obsolete function (Bug#4372).
 
@@ -26,8 +31,8 @@
        (time-stamp-dd/mm/yyyy, time-stamp-mon-dd-yyyy)
        (time-stamp-dd-mon-yy, time-stamp-yy/mm/dd)
        (time-stamp-yyyy/mm/dd, time-stamp-yyyy-mm-dd)
-       (time-stamp-yymmdd, time-stamp-hh:mm:ss, time-stamp-hhmm): Remove
-       functions that have been obsolete since 1995 (Bug#4436).
+       (time-stamp-yymmdd, time-stamp-hh:mm:ss, time-stamp-hhmm):
+       Remove functions that have been obsolete since 1995 (Bug#4436).
 
        * progmodes/sh-script.el (sh-learn-buffer-indent): Pop to the
        indent buffer only if called interactively (Bug#4452).
index debfac03140022fdd148501e31e1fb27bfd845b7..bd8511cda71ddda3c4e1dd1b503b5ba0148d9744 100644 (file)
@@ -1301,7 +1301,12 @@ for a file, defaulting to the file defined by variable
     (let ((print-length nil)
           (print-level nil))
       (bookmark-insert-file-format-version-stamp)
-      (pp bookmark-alist (current-buffer))
+      (insert "(")
+      ;; Rather than a single call to `pp' we make one per bookmark.
+      ;; Apparently `pp' has a poor algorithmic complexity, so this
+      ;; scales a lot better.  bug#4485.
+      (dolist (i  bookmark-alist) (pp i (current-buffer)))
+      (insert ")")
       (let ((version-control
              (cond
               ((null bookmark-version-control) nil)