emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gnosis 88a32f1918 13/19: edit-update-note: Update assertio


From: ELPA Syncer
Subject: [nongnu] elpa/gnosis 88a32f1918 13/19: edit-update-note: Update assertions.
Date: Thu, 5 Sep 2024 13:00:31 -0400 (EDT)

branch: elpa/gnosis
commit 88a32f19180e36ce31f1819171ce9a9337c70568
Author: Thanos Apollo <public@thanosapollo.org>
Commit: Thanos Apollo <public@thanosapollo.org>

    edit-update-note: Update assertions.
    
    * Update assertions, to avoid edits that will lead to bugs such as
      inserting numbers to the tags list.
---
 gnosis.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index db5a6f4c85..a722fe1ca8 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1986,10 +1986,12 @@ SUSPEND: Suspend note, 0 for unsuspend, 1 for suspend"
             "Second-image must be a string, path to image file from 
`gnosis-images-dir', or nil")
   (cl-assert (or (stringp extra-notes) (null extra-notes)) nil
             "Extra-notes must be a string, or nil")
-  (cl-assert (listp tags) nil "Tags must be a list of strings")
-  (cl-assert (and (listp gnosis) (length= gnosis 3)) nil "gnosis must be a 
list of 3 floats")
-  (cl-assert (or (stringp options) (listp options)) nil "Options must be a 
string, or a list for MCQ")
-  (cl-assert (or (= suspend 0) (= suspend 1)) nil "Suspend must be either 0 or 
1")
+  (cl-assert (and (listp tags) (cl-every #'stringp tags)) nil "Tags must be a 
list of strings")
+  (cl-assert (and (listp gnosis) (length= gnosis 3) (cl-every #'floatp gnosis))
+            nil "gnosis must be a list of 3 floats")
+  (cl-assert (or (stringp options) (and (listp options) (cl-every #'stringp 
options)))
+            nil "Options must be a string or a list of strings")
+  (cl-assert (and (numberp suspend) (or (= suspend 0) (= suspend 1))) nil 
"Suspend must be either 0 or 1")
   (when (and (string= (gnosis-get-type id) "cloze")
             (not (stringp options)))
     (cl-assert (or (listp options) (stringp options)) nil "Options must be a 
list or a string.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]