From 6019446af60a8a4a7abe63b38791c3d738f7a44e Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 10 Nov 2014 21:44:33 +0100 Subject: [PATCH] (eww-save-history): Don't let the history grow infinitely. --- lisp/ChangeLog | 1 + lisp/net/eww.el | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bc31f5d14bb..1eb7ca9cb2e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 diff --git a/lisp/net/eww.el b/lisp/net/eww.el index b697fa32f4b..76fb0c8743f 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -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." -- 2.11.4.GIT