summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-06 20:30:22 +0300
committerThanos Apollo <[email protected]>2024-08-06 20:30:22 +0300
commit06eafd6979c5fb91fa74686286556dce56fd4dd5 (patch)
treee884cd1def337b38877c00d56fbf9279b465342b
parent0ccc44e31330ca2347f3d93ef1e305f4b974e81f (diff)
delete-note: Add verification optional arg
* Optionally skip verification.
-rw-r--r--gnosis.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/gnosis.el b/gnosis.el
index 6c9e88d..90a2f3c 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -331,9 +331,11 @@ Example:
"From TABLE use where to delete VALUE."
(emacsql gnosis-db `[:delete :from ,table :where ,value]))
-(defun gnosis-delete-note (id)
- "Delete note with ID."
- (when (y-or-n-p "Delete note?")
+(defun gnosis-delete-note (id &optional verification)
+ "Delete note with ID.
+
+When VERIFICATION is non-nil, skip `y-or-n-p' prompt."
+ (when (or verification (y-or-n-p "Delete note?"))
(emacsql-with-transaction gnosis-db (gnosis--delete 'notes `(= id ,id)))))
(defun gnosis-delete-deck (&optional id)