aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/byte-opt.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 0bf5a7904c2..7aa34cff6bc 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1168,6 +1168,18 @@
1168 (if (equal '((quote xemacs)) (cdr-safe form)) 1168 (if (equal '((quote xemacs)) (cdr-safe form))
1169 nil 1169 nil
1170 form)) 1170 form))
1171
1172(put 'set 'byte-optimizer 'byte-optimize-set)
1173(defun byte-optimize-set (form)
1174 (let ((var (car-safe (cdr-safe form))))
1175 (cond
1176 ((and (eq (car-safe var) 'quote) (consp (cdr var)))
1177 (list* 'setq (cadr var) (cddr form)))
1178 ((and (eq (car-safe var) 'make-local-variable)
1179 (eq (car-safe (setq var (car-safe (cdr var)))) 'quote)
1180 (consp (cdr var)))
1181 `(progn ,(cadr form) (setq ,(cadr var) ,@(cddr form))))
1182 (t form))))
1171 1183
1172;;; enumerating those functions which need not be called if the returned 1184;;; enumerating those functions which need not be called if the returned
1173;;; value is not used. That is, something like 1185;;; value is not used. That is, something like