summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-03-03 02:20:31 +0200
committerThanos Apollo <[email protected]>2024-03-03 02:20:31 +0200
commita6a05cc437b940f9b9cf4cc6f0aa6a380976705c (patch)
treefe948c14851484a73b9ee2921dd55532a7238741 /gnosis.el
parent90c2775f05adcc870758a5ac4ae7b8d51ce9d1d9 (diff)
Add gnosis-assert-number-or-nil
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index fdf7516..e166eaa 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1250,6 +1250,11 @@ Insert deck values `ef-increase', `ef-decrease', `ef-threshold', `failure-factor
(unless (or (null value) (floatp value))
(error "Invalid value: %s, %s" value description))))
+(defun gnosis-assert-number-or-nil (value description)
+ "Assert that VALUE is a number or nil."
+ (unless (or (null value) (numberp value))
+ (error "Invalid value: %s, %s" value description)))
+
(cl-defun gnosis-edit-save-exit (&optional deck-edit (exit-func 'exit-recursive-edit) &rest args)
"Save edits and exit.