(Emacs/elisp)+org-bookmark/make-bookmark function

This will allow for easy automation when using ytsearch: every pair of
results can be wrapped in this expression to generate the videos I
want.
This commit is contained in:
2024-07-27 16:56:23 +01:00
parent f740c21d79
commit 35a527c656

View File

@@ -31,6 +31,16 @@
(defvar org-bookmark/file (expand-file-name (concat org-directory "/bookmarks.org"))) (defvar org-bookmark/file (expand-file-name (concat org-directory "/bookmarks.org")))
(defun org-bookmark/make-bookmark (name url)
"Insert a properly formatted bookmark into ORG-BOOKMARK/FILE
composed of NAME and URL."
(with-current-buffer (find-file org-bookmark/file)
(org-insert-heading-respect-content)
(insert (concat name " :bookmark:"))
(org-set-property "url" url)
(next-line 2)
(org-insert-time-stamp (time-stamp) t)))
(defun org-bookmark/--get-heading-data () (defun org-bookmark/--get-heading-data ()
"In an org-mode buffer, with point on a heading: get the title, "In an org-mode buffer, with point on a heading: get the title,
tags and url." tags and url."