From 06eafd6979c5fb91fa74686286556dce56fd4dd5 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 6 Aug 2024 20:30:22 +0300 Subject: delete-note: Add verification optional arg * Optionally skip verification. --- gnosis.el | 8 +++++--- 1 file 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) -- cgit v1.2.3