Automatically evaluate top-level define-obsolete-function-alias etc

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-make-obsolete):
New handler.
This commit is contained in:
Glenn Morris 2017-12-15 16:22:25 -05:00
parent 6c301afa70
commit 5e6fb1e246

View file

@ -2486,6 +2486,12 @@ list that represents a doc string reference.
(mapc 'byte-compile-file-form (cdr form))
nil))
;; Automatically evaluate define-obsolete-function-alias etc at top-level.
(put 'make-obsolete 'byte-hunk-handler 'byte-compile-file-form-make-obsolete)
(defun byte-compile-file-form-make-obsolete (form)
(prog1 (byte-compile-keep-pending form)
(apply 'make-obsolete (mapcar 'eval (cdr form)))))
;; This handler is not necessary, but it makes the output from dont-compile
;; and similar macros cleaner.
(put 'eval 'byte-hunk-handler 'byte-compile-file-form-eval)