branch: externals/transient commit 017eb7b3cb631bb432066539c459bfa96afa0543 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Explicitly define generic functions The byte-compiler of Emacs 29 went completely berserk and so I learned that it recently stopped being possible to define a method for a (previously undefined) function without first explicitly declaring it as a generic function. --- lisp/transient.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/transient.el b/lisp/transient.el index 31b79947de..5aa7b6e6fb 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -2522,7 +2522,7 @@ transient is active." (transient-save-value (or transient--prefix transient-current-prefix))) (defun transient-reset () - "Clear the set and saved value of the active transient." + "Clear the set and saved values of the active transient." (interactive) (transient-reset-value (or transient--prefix transient-current-prefix))) @@ -2916,12 +2916,18 @@ prompt." (transient-infix-set obj nil))))) (cl-call-next-method obj value)))) +(cl-defgeneric transient-set-value (obj) + "Set the value of the transient prefix OBJ.") + (cl-defmethod transient-set-value ((obj transient-prefix)) (oset (oref obj prototype) value (transient-get-value)) (transient--history-push obj)) ;;;; Save +(cl-defgeneric transient-save-value (obj) + "Save the value of the transient prefix OBJ.") + (cl-defmethod transient-save-value ((obj transient-prefix)) (let ((value (transient-get-value))) (oset (oref obj prototype) value value) @@ -2931,6 +2937,9 @@ prompt." ;;;; Reset +(cl-defgeneric transient-reset-value (obj) + "Clear the set and saved values of the transient prefix OBJ.") + (cl-defmethod transient-reset-value ((obj transient-prefix)) (let ((value (transient-default-value obj))) (oset obj value value)