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

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

Re: undo error


From: Richard Stallman
Subject: Re: undo error
Date: Sun, 29 Feb 2004 21:05:49 -0500

    When I press undo (`C-_') twice in a buffer where undo information
    has been disabled -- i.e. `buffer-undo-list' is t -- I get this
    backtrace the second time:

Does this patch give good results?

diff -c /home/rms/emacs/lisp/simple.el.\~72\~ /home/rms/emacs/lisp/simple.el
*** /home/rms/emacs/lisp/simple.el.~72~ Sat Feb 28 12:39:20 2004
--- /home/rms/emacs/lisp/simple.el      Sun Feb 29 16:43:18 2004
***************
*** 972,980 ****
    ;; another undo command will find the undo history empty
    ;; and will get another error.  To begin undoing the undos,
    ;; you must type some other command.
-   (setq this-command 'undo)
    (let ((modified (buffer-modified-p))
        (recent-save (recent-auto-save-p)))
      (unless (eq last-command 'undo)
        (setq undo-in-region
            (if transient-mark-mode mark-active (and arg (not (numberp arg)))))
--- 972,984 ----
    ;; another undo command will find the undo history empty
    ;; and will get another error.  To begin undoing the undos,
    ;; you must type some other command.
    (let ((modified (buffer-modified-p))
        (recent-save (recent-auto-save-p)))
+     ;; If we get an error in undo-start,
+     ;; the next command should not be a "consecutive undo".
+     ;; So set `this-command' to something other than `undo'.
+     (setq this-command 'undo-start)
+ 
      (unless (eq last-command 'undo)
        (setq undo-in-region
            (if transient-mark-mode mark-active (and arg (not (numberp arg)))))
***************
*** 983,988 ****
--- 987,994 ----
        (undo-start))
        ;; get rid of initial undo boundary
        (undo-more 1))
+     ;; If we got this far, the next command should be a consecutive undo. 
+     (setq this-command 'undo)
      ;; Check to see whether we're hitting a redo record, and if
      ;; so, ask the user whether she wants to skip the redo/undo pair.
      (let ((equiv (gethash pending-undo-list undo-equiv-table)))

Diff finished.  Sun Feb 29 16:43:39 2004




reply via email to

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