From: Lars Magne Ingebrigtsen Date: Mon, 30 Aug 2010 18:17:20 +0000 (+0200) Subject: Limit the undo actions to 100 actions. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=854bddc2d74ce7087c65f174a15d9e4958a7fd54;p=gnus Limit the undo actions to 100 actions. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01ec45801..9ab0d1ebb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-08-30 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/gnus-undo.el b/lisp/gnus-undo.el index d11b778f3..802ae63ca 100644 --- a/lisp/gnus-undo.el +++ b/lisp/gnus-undo.el @@ -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