diff options
author | Thanos Apollo <[email protected]> | 2024-08-06 20:30:22 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-06 20:30:22 +0300 |
commit | 06eafd6979c5fb91fa74686286556dce56fd4dd5 (patch) | |
tree | e884cd1def337b38877c00d56fbf9279b465342b /gnosis.el | |
parent | 0ccc44e31330ca2347f3d93ef1e305f4b974e81f (diff) |
delete-note: Add verification optional arg
* Optionally skip verification.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |