summaryrefslogtreecommitdiff
path: root/org-gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-12-06 15:44:48 +0200
committerThanos Apollo <[email protected]>2024-12-06 15:44:48 +0200
commit9e0d7da6a10af00c7c0502b135ce61424412989c (patch)
treeddc15bf06e70324d84aae3a95946770081cf9842 /org-gnosis.el
parent5bcbca8fccbd46c7fc4efa0cad6ee270111d77e2 (diff)
Add insert-tag
Diffstat (limited to 'org-gnosis.el')
-rw-r--r--org-gnosis.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/org-gnosis.el b/org-gnosis.el
index 0291cc1..e93dde2 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -377,6 +377,22 @@ instead."
(org-insert-link nil id node)))
;;;###autoload
+(defun org-gnosis-insert-tag ()
+ "Insert filetag."
+ (interactive)
+ (let* ((filetags (org-gnosis-select 'tag 'tags '1=1 t))
+ (tag (funcall org-gnosis-completing-read-func "Select tag: " filetags)))
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward "^#\\+FILETAGS:" nil t)
+ (progn
+ (end-of-line)
+ (insert (if (looking-back ":" nil) "" ":") tag ":"))
+ (progn
+ (insert "#+FILETAGS: :" tag ":")
+ (newline))))))
+
+;;;###autoload
(defun org-gnosis-journal-find (&optional date)
"Find journal entry for DATE."
(interactive)