summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-07-07 03:06:28 +0000
committerRoland McGrath <roland@gnu.org>1993-07-07 03:06:28 +0000
commit8ccc377f964b5327269f74968b43096ab0c01671 (patch)
tree744a03a29390e7f0eb122124fae0cae035808074 /lisp/emacs-lisp/bytecomp.el
parent23de57664f87e4d65e55ba32c2bbf122c01ca0c2 (diff)
downloademacs-8ccc377f964b5327269f74968b43096ab0c01671.tar.gz
emacs-8ccc377f964b5327269f74968b43096ab0c01671.tar.bz2
emacs-8ccc377f964b5327269f74968b43096ab0c01671.zip
(byte-compile-setq-default): Handle multiple pairs args like setq (as
the setq-default subr does).
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index e3969cf4f85..6bbe1eba7e7 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -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))))