From: Richard M. Stallman Date: Sun, 18 May 2003 15:04:24 +0000 (+0000) Subject: (prepare-change-group): Reinstate BUFFER arg; make it work. X-Git-Tag: ttn-vms-21-2-B4~10101 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=62ea1306280ecf6712c87c865adbf4e3525a2788;p=emacs.git (prepare-change-group): Reinstate BUFFER arg; make it work. --- diff --git a/lisp/subr.el b/lisp/subr.el index 54e1d04df22..78f311385a1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1242,8 +1242,9 @@ user can undo the change normally." (accept-change-group ,handle) (cancel-change-group ,handle)))))) -(defun prepare-change-group () +(defun prepare-change-group (&optional buffer) "Return a handle for the current buffer's state, for a change group. +If you specify BUFFER, make a handle for BUFFER's state instead. Pass the handle to `activate-change-group' afterward to initiate the actual changes of the change group. @@ -1269,7 +1270,9 @@ You can then activate that multibuffer change group with a single call to `activate-change-group' and finish it with a single call to `accept-change-group' or `cancel-change-group'." - (list (cons (current-buffer) buffer-undo-list))) + (if buffer + (list (cons buffer (with-current-buffer buffer buffer-undo-list))) + (list (cons (current-buffer) buffer-undo-list)))) (defun activate-change-group (handle) "Activate a change group made with `prepare-change-group' (which see)."