[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.")
- [nongnu] elpa/gnosis cfa0462972 01/19: packaging: Version 0.4.2-dev, (continued)
- [nongnu] elpa/gnosis cfa0462972 01/19: packaging: Version 0.4.2-dev, ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 061633adca 03/19: packaging: Require emacsql-4.0.1., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 487d903de1 04/19: New file: Add manifest.scm, ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 02a4e13520 12/19: [fix] display-images: Display images only on graphical envs., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis bb1469aad5 08/19: Update todos., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis bc626d511c 16/19: dashboard: Update dashboard-mode keymap., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 8f0bb68c87 14/19: demo: Update formatting (aesthetics)., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 52da178372 15/19: Rewrite README as markdown, ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 731f0ba491 19/19: Release version 0.4.2., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 907308c45e 06/19: makefile: Add tests & use quick (-Q) option., ELPA Syncer, 2024/09/05
- [nongnu] elpa/gnosis 88a32f1918 13/19: edit-update-note: Update assertions.,
ELPA Syncer <=
- [nongnu] elpa/gnosis f9c6885cd5 17/19: doc: Update for new version., ELPA Syncer, 2024/09/05