]> code.delx.au - gnu-emacs/blobdiff - lisp/subr.el
*** empty log message ***
[gnu-emacs] / lisp / subr.el
index 864af300e3e3a59cb8993d514a4574386e0aaa59..78f311385a1e27e400d3f1d5ced09d485b55be01 100644 (file)
@@ -43,13 +43,17 @@ This is set as the value of the variable `macro-declaration-function'.
 MACRO is the name of the macro being defined.
 DECL is a list `(declare ...)' containing the declarations.
 The return value of this function is not used."
-  (dolist (d (cdr decl))
-    (cond ((and (consp d) (eq (car d) 'indent))
-          (put macro 'lisp-indent-function (cadr d)))
-         ((and (consp d) (eq (car d) 'debug))
-          (put macro 'edebug-form-spec (cadr d)))
-         (t
-          (message "Unknown declaration %s" d)))))
+  ;; We can't use `dolist' or `cadr' yet for bootstrapping reasons.
+  (let (d)
+    ;; Ignore the first element of `decl' (it's always `declare').
+    (while (setq decl (cdr decl))
+      (setq d (car decl))
+      (cond ((and (consp d) (eq (car d) 'indent))
+            (put macro 'lisp-indent-function (car (cdr d))))
+           ((and (consp d) (eq (car d) 'debug))
+            (put macro 'edebug-form-spec (car (cdr d))))
+           (t
+            (message "Unknown declaration %s" d))))))
 
 (setq macro-declaration-function 'macro-declaration-function)
 
@@ -1238,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.
@@ -1265,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)."