comparison lisp/utils/redo.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 8fc7fe29b841
children f53b5ca2e663
comparison
equal deleted inserted replaced
23:0edd3412f124 24:4103f0995bd7
61 61
62 ;;; Code: 62 ;;; Code:
63 63
64 (provide 'redo) 64 (provide 'redo)
65 65
66 (defvar redo-version "1.00" 66 (defvar redo-version "1.01"
67 "Version number for the Redo package.") 67 "Version number for the Redo package.")
68 68
69 (defvar last-buffer-undo-list nil 69 (defvar last-buffer-undo-list nil
70 "The head of buffer-undo-list at the last time an undo or redo was done.") 70 "The head of buffer-undo-list at the last time an undo or redo was done.")
71 (make-variable-buffer-local 'last-buffer-undo-list) 71 (make-variable-buffer-local 'last-buffer-undo-list)
72
73 (make-variable-buffer-local 'pending-undo-list)
72 74
73 (defun redo (&optional count) 75 (defun redo (&optional count)
74 "Redo the the most recent undo. 76 "Redo the the most recent undo.
75 Prefix arg COUNT means redo the COUNT most recent undos. 77 Prefix arg COUNT means redo the COUNT most recent undos.
76 If you have modified the buffer since the last redo or undo, 78 If you have modified the buffer since the last redo or undo,
92 (let ((modified (buffer-modified-p)) 94 (let ((modified (buffer-modified-p))
93 (recent-save (recent-auto-save-p)) 95 (recent-save (recent-auto-save-p))
94 (old-undo-list buffer-undo-list) 96 (old-undo-list buffer-undo-list)
95 (p (cdr buffer-undo-list)) 97 (p (cdr buffer-undo-list))
96 (records-between 0)) 98 (records-between 0))
97 ;; count the number of undo records between the head of teh 99 ;; count the number of undo records between the head of the
98 ;; undo chain and the pointer to the next change. Note that 100 ;; undo chain and the pointer to the next change. Note that
99 ;; by `record' we mean clumps of change records, not the 101 ;; by `record' we mean clumps of change records, not the
100 ;; boundary records. The number of records will always be a 102 ;; boundary records. The number of records will always be a
101 ;; multiple of 2, because an undo moves the pending pointer 103 ;; multiple of 2, because an undo moves the pending pointer
102 ;; forward one record and prepend a record to the head of the 104 ;; forward one record and prepend a record to the head of the