]> code.delx.au - gnu-emacs/commitdiff
(eww-history-limit): New variable.
authorIvan Shmakov <ivan@siamics.net>
Wed, 19 Nov 2014 17:28:19 +0000 (18:28 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 19 Nov 2014 17:28:19 +0000 (18:28 +0100)
* net/eww.el (eww-history-limit): New variable.
(eww-save-history): Use it.

lisp/ChangeLog
lisp/net/eww.el

index 4c8a48b40cd211afd13e1439120801b91cf2b884..1194ba7aa7cd95c9c26bf0ec69fde5fd3503a107 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-19  Ivan Shmakov  <ivan@siamics.net>
+
+       * net/eww.el (eww-history-limit): New variable.
+       (eww-save-history): Use it.
+
 2014-11-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * net/eww.el (eww-desktop-misc-data): Use `cl-remove-duplicates'.
index 76e14be4d7938135da86e8a15a6147bdc07f1ef0..83d96f50b1a9c3b0ad6f0a9097e307a439f62b52 100644 (file)
@@ -95,6 +95,12 @@ The string will be passed through `substitute-command-keys'."
   :group 'eww
   :type 'string)
 
+(defcustom eww-history-limit 50
+  "Maximum number of entries to retain in the history."
+  :version "25.1"
+  :group 'eww
+  :type '(choice (const :tag "Unlimited" nil)
+                 integer))
 (defcustom eww-use-external-browser-for-content-type
   "\\`\\(video/\\|audio/\\|application/ogg\\)"
   "Always use external browser for specified content-type."
@@ -1487,7 +1493,8 @@ Differences in #targets are ignored."
   (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))
+  (when-let (tail (and eww-history-limit
+                      (nthcdr eww-history-limit eww-history)))
     (setcdr tail nil)))
 
 (defun eww-list-histories ()