Turn jupyter-add-finalizer into a function

This commit is contained in:
Nathaniel Nicandro 2020-09-09 14:27:01 -05:00
parent 36f714a0d0
commit 658886780e

View file

@ -375,9 +375,10 @@ class corresponding to the symbol `jupyter-instance-tracker'."
(defvar jupyter-finalizers (make-hash-table :weakness 'key :test #'eq)) (defvar jupyter-finalizers (make-hash-table :weakness 'key :test #'eq))
(cl-defgeneric jupyter-add-finalizer (obj (fn function)) (defun jupyter-add-finalizer (obj fn)
"Add FN to the finalizers of OBJ." "Add FN to the finalizers of OBJ."
(declare (indent 1)) (declare (indent 1))
(cl-check-type fn function)
(cl-callf append (gethash obj jupyter-finalizers) (cl-callf append (gethash obj jupyter-finalizers)
(list (make-finalizer fn)))) (list (make-finalizer fn))))