]> git.eshelyaron.com Git - emacs.git/commitdiff
Use unload-function instead of unload-hook in ert
authorStefan Kangas <stefankangas@gmail.com>
Sun, 9 Feb 2025 21:16:09 +0000 (22:16 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 10 Feb 2025 20:56:12 +0000 (21:56 +0100)
* 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)

lisp/emacs-lisp/ert.el

index f892e12fa86bbc0bb8b0c692a52a7e99bb568172..fc1a4f22c96da970f97e4e85211d765d9ddf3fbf 100644 (file)
@@ -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