comparison lisp/simple.el @ 59055:f6e8a2dc456a

(undo-outer-limit-truncate): New function. (undo-outer-limit-function): Use undo-outer-limit-truncate.
author Richard M. Stallman <rms@gnu.org>
date Tue, 21 Dec 2004 11:37:52 +0000
parents 2a281af9d3ad
children 25e00b2ef82f 4ee39d9428b0 eac554634bfa
comparison
equal deleted inserted replaced
59054:a32a0ec1c9ac 59055:f6e8a2dc456a
1482 ;; (BEGIN . END) 1482 ;; (BEGIN . END)
1483 (cons (car undo-elt) (- (car undo-elt) (cdr undo-elt)))) 1483 (cons (car undo-elt) (- (car undo-elt) (cdr undo-elt))))
1484 (t 1484 (t
1485 '(0 . 0))) 1485 '(0 . 0)))
1486 '(0 . 0))) 1486 '(0 . 0)))
1487
1488 ;; When the first undo batch in an undo list is longer than undo-outer-limit,
1489 ;; this function gets called to ask the user what to do.
1490 ;; Garbage collection is inhibited around the call,
1491 ;; so it had better not do a lot of consing.
1492 (setq undo-outer-limit-function 'undo-outer-limit-truncate)
1493 (defun undo-outer-limit-truncate (size)
1494 (if (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? "
1495 (buffer-name) size))
1496 (progn (setq buffer-undo-list nil) t)
1497 nil))
1487 1498
1488 (defvar shell-command-history nil 1499 (defvar shell-command-history nil
1489 "History list for some commands that read shell commands.") 1500 "History list for some commands that read shell commands.")
1490 1501
1491 (defvar shell-command-switch "-c" 1502 (defvar shell-command-switch "-c"