From: Katsumi Yamaoka Date: Mon, 30 Aug 2010 23:47:12 +0000 (+0000) Subject: Limit the undo actions to 100 actions by Lars Magne Ingebrigtsen . X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~197 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75856ec0cbcd53214b96c36f2c0ee391b061c912;p=emacs.git Limit the undo actions to 100 actions by Lars Magne Ingebrigtsen . --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 991a9910e7f..19160dc8faf 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/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/gnus-undo.el b/lisp/gnus/gnus-undo.el index d11b778f351..802ae63caa4 100644 --- a/lisp/gnus/gnus-undo.el +++ b/lisp/gnus/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