]> git.eshelyaron.com Git - emacs.git/commitdiff
(eww-save-history): Don't let the history grow infinitely.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 10 Nov 2014 20:44:33 +0000 (21:44 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 10 Nov 2014 20:44:33 +0000 (21:44 +0100)
lisp/ChangeLog
lisp/net/eww.el

index bc31f5d14bb95a097c34fa3884960b81015397f5..1eb7ca9cb2edcacd2460b9dc2e6f6b9d33cc0d05 100644 (file)
@@ -5,6 +5,7 @@
        variables `eww-current-url', `eww-current-dom',
        `eww-current-source', and `eww-current-title'.
        (eww-readable): Copy over pertinent data from the parent page.
+       (eww-save-history): Don't let the history grow infinitely.
 
        * net/eww.el: Remove `eww-next-url', `eww-previous-url',
        `eww-up-url', `eww-home-url', `eww-start-url' and
index b697fa32f4b32244513c827f1e40858bb59fbac7..76fb0c8743f5eee37e9b9af73951895b26799025 100644 (file)
@@ -1344,7 +1344,11 @@ Differences in #targets are ignored."
   (plist-put eww-data :point (point))
   (plist-put eww-data :text (buffer-string))
   (push eww-data eww-history)
-  (setq eww-data (list :title "")))
+  (setq eww-data (list :title ""))
+  ;; Don't let the history grow infinitely.  We store quite a lot of
+  ;; data per page.
+  (when-let (tail (nthcdr 50 eww-history))
+    (setcdr tail nil)))
 
 (defun eww-list-histories ()
   "List the eww-histories."