summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/byte-opt.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index b51ba801552..b3325816c5c 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -607,9 +607,12 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
(setq args (cddr args)))
(cons fn (nreverse var-expr-list))))
- (`(defvar ,(and (pred symbolp) name) . ,_)
- (push name byte-optimize--dynamic-vars)
- form)
+ (`(defvar ,(and (pred symbolp) name) . ,rest)
+ (let ((optimized-rest (and rest
+ (cons (byte-optimize-form (car rest) nil)
+ (cdr rest)))))
+ (push name byte-optimize--dynamic-vars)
+ `(defvar ,name . ,optimized-rest)))
(`(,(pred byte-code-function-p) . ,exps)
(cons fn (mapcar #'byte-optimize-form exps)))