summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-03-25 03:40:04 +0000
committerjao <jao@gnu.org>2021-03-25 03:40:04 +0000
commit3815e003ffd6ba245938c67f5ecebcdf75e90226 (patch)
treeacb13a6f45d174583dfe085ef63c5fbfb6d203bb /lib
parente83f44570d456fb37342f97ed30a6cc01ecfd843 (diff)
downloadelibs-3815e003ffd6ba245938c67f5ecebcdf75e90226.tar.gz
elibs-3815e003ffd6ba245938c67f5ecebcdf75e90226.tar.bz2
jao-org-notes: insert tags interactively
Diffstat (limited to 'lib')
-rw-r--r--lib/org/jao-org-notes.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/org/jao-org-notes.el b/lib/org/jao-org-notes.el
index 621ac12..a1b9dbe 100644
--- a/lib/org/jao-org-notes.el
+++ b/lib/org/jao-org-notes.el
@@ -92,10 +92,12 @@
(org-global-tags-completion-table
(directory-files-recursively jao-org-notes-dir ".*\\.org"))))
-(defun jao-org-notes--insert-tags ()
+(defun jao-org-notes--read-tags ()
(unless jao-org-notes--tags (jao-org-notes--update-tags))
- (let ((ts (completing-read-multiple "Tags: " jao-org-notes--tags)))
- (insert "#+filetags: " (mapconcat 'identity ts " ") "\n")))
+ (completing-read-multiple "Tags: " jao-org-notes--tags))
+
+(defun jao-org-notes--insert-tags ()
+ (insert "#+filetags: " (mapconcat #'identity (jao-org-notes--read-tags) " ") "\n"))
(defun jao-org-notes--insert-date ()
(insert "#+date: ")
@@ -133,6 +135,12 @@
(concat "\\[\\[file:(.*/)?" (regexp-quote (buffer-name)))))
;;;###autoload
+(defun jao-org-notes-insert-tags ()
+ "Insert a list of tags at point, with completing read."
+ (interactive)
+ (insert (mapconcat 'identity (jao-org-notes--read-tags) " ")))
+
+;;;###autoload
(defun jao-org-notes-insert-link ()
"Select a note file (with completion) and insert a link to it."
(interactive)