Limit the undo actions to 100 actions.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 30 Aug 2010 18:17:20 +0000 (20:17 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 30 Aug 2010 18:17:20 +0000 (20:17 +0200)
lisp/ChangeLog
lisp/gnus-undo.el

index 01ec458..9ab0d1e 100644 (file)
@@ -1,5 +1,8 @@
 2010-08-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-undo.el (gnus-undo-register-1): Limit the undo actions to 100
+       actions. 
+
        * gnus-group.el (gnus-group-completing-read): Protect against not
        having completion-styles bound.
 
index d11b778..802ae63 100644 (file)
@@ -154,6 +154,9 @@ FORMS may use backtick quote syntax."
      ;; We are on a boundary, so we create a new action.
      (gnus-undo-boundary
       (push (list function) gnus-undo-actions)
+      ;; Don't let the undo actions grow infinitely.
+      (when (> (length gnus-undo-actions) 100)
+       (setcdr (nthcdr 100 gnus-undo-actions) nil))
       (setq gnus-undo-boundary nil))
      ;; Prepend the function to an old action.
      (gnus-undo-actions