From: Stefan Kangas Date: Sun, 9 Feb 2025 21:16:09 +0000 (+0100) Subject: Use unload-function instead of unload-hook in ert X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7666a6f528430595ba890b0af080e0b080ef54e6;p=emacs.git Use unload-function instead of unload-hook in ert * lisp/emacs-lisp/ert.el (ert-unload-function): Rename from 'ert--unload-function'. (ert--unload-function): Make into obsolete function alias for the above. (cherry picked from commit 859608c05152ef7efdc55b3fcd3997d7801125f8) --- diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index f892e12fa86..fc1a4f22c96 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -2846,7 +2846,7 @@ To be used in the ERT results buffer." (ert--tests-running-mode-line-indicator)))) (add-hook 'emacs-lisp-mode-hook #'ert--activate-font-lock-keywords) -(defun ert--unload-function () +(defun ert-unload-function () "Unload function to undo the side-effects of loading ert.el." (ert--remove-from-list 'minor-mode-alist 'ert--current-run-stats :key #'car) (ert--remove-from-list 'emacs-lisp-mode-hook @@ -2979,9 +2979,6 @@ write erts files." (forward-line 1))) (nreverse specs)))) -(defvar ert-unload-hook ()) -(add-hook 'ert-unload-hook #'ert--unload-function) - ;;; Obsolete (define-obsolete-function-alias 'ert-equal-including-properties @@ -2989,6 +2986,8 @@ write erts files." (put 'ert-equal-including-properties 'ert-explainer 'ert--explain-equal-including-properties) +(define-obsolete-function-alias 'ert--unload-function 'ert-unload-function "31.1") + (provide 'ert) ;;; ert.el ends here