diff options
author | Thanos Apollo <[email protected]> | 2024-08-11 23:05:31 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-11 23:05:31 +0300 |
commit | 73329e0ebfda93ebe99471788c2a9f1d17ca954b (patch) | |
tree | 60f64d0adaeb97609501196d4181c8ddfecc85ea | |
parent | 66007456f5fdb2f95a0bb91bd15ed5b6f7a45ea9 (diff) |
New function: tags--append.
* Append tag to the list of tags of note ID.
* Meant to be used to auto tag notes, such as for overdue and to edit
notes during dashboard view.
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2232,6 +2232,14 @@ Defaults to current date." (let* ((date (or date (gnosis-algorithm-date))) (reviewed-new (or (car (gnosis-select 'reviewed-new 'activity-log `(= date ',date) t)) 0))) reviewed-new)) +;; TODO: Auto tag overdue tags +(defun gnosis-tags--append (id tag) + "Append TAG to the list of tags of note ID." + (cl-assert (numberp id) nil "ID must be the note id number") + (cl-assert (stringp tag) nil "Tag must a string") + (let* ((current-tags (gnosis-get 'tags 'notes `(= id ,id))) + (new-tags (append current-tags (list tag)))) + (gnosis-update 'notes `(= tags ',new-tags) `(= id ,id)))) (cl-defun gnosis-export-note (id &optional (export-for-deck nil)) "Export fields for note with value of id ID. |