]> git.eshelyaron.com Git - emacs.git/commitdiff
(byte-compile-setq-default): Handle multiple pairs args like setq (as
authorRoland McGrath <roland@gnu.org>
Wed, 7 Jul 1993 03:06:28 +0000 (03:06 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 7 Jul 1993 03:06:28 +0000 (03:06 +0000)
the setq-default subr does).

lisp/emacs-lisp/bytecomp.el

index e3969cf4f851e61224ee6295d9cf8d3ad675cafe..6bbe1eba7e7f15ca0ae7c86c19802334578cd1c1 100644 (file)
@@ -2420,9 +2420,15 @@ If FORM is a lambda or a macro, byte-compile it as a function."
     (setq for-effect nil)))
 
 (defun byte-compile-setq-default (form)
-  (byte-compile-form
-   (cons 'set-default (cons (list 'quote (nth 1 form))
-                           (nthcdr 2 form)))))
+  (let ((args (cdr form)))
+    (if args
+       (while args
+         (byte-compile-form
+          (list 'set-default (list 'quote (car args)) (car (cdr args))))
+         (setq args (cdr (cdr args))))
+      ;; (setq-default), with no arguments.
+      (byte-compile-form nil for-effect))
+    (setq for-effect nil)))
 
 (defun byte-compile-quote (form)
   (byte-compile-constant (car (cdr form))))