emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undo discard prompt


From: Richard Stallman
Subject: Re: Undo discard prompt
Date: Wed, 26 Jan 2005 20:56:40 -0500

I wrote:

    I think this question should always be asked on the terminal,
    temporarily suspending the keyboard macro.

Does this replacement do it?

(defun undo-outer-limit-truncate (size)
  (when (or (null undo-extra-outer-limit)
            (> size undo-extra-outer-limit))
    ;; Don't ask the question again unless it gets even bigger.
    ;; This applies, in particular, if the user quits from the question.
    ;; Such a quit quits out of GC, but something else will call GC
    ;; again momentarily.  It will call this function again,
    ;; but we don't want to ask the question again.
    (setq undo-extra-outer-limit (+ size 50000))
    (if (let (use-dialog-box
              executing-kbd-macro)
          (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard 
it? "
                               (buffer-name) size)))
        (progn (setq buffer-undo-list nil)
               (setq undo-extra-outer-limit nil)
               t)
      nil)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]