From 5e6fb1e246b1e7f44ebba48e7e24f597a8eb92dd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 15 Dec 2017 16:22:25 -0500 Subject: [PATCH] Automatically evaluate top-level define-obsolete-function-alias etc * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-make-obsolete): New handler. --- lisp/emacs-lisp/bytecomp.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 995fb05eac8..c898305d916 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -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) -- 2.39.2