Add functions for tracking music (performances and scrobbles)

This commit is contained in:
mez 2024-01-03 21:45:44 +00:00
parent 5b16cd2480
commit d451b56eeb
2 changed files with 72 additions and 36 deletions

View file

@ -1,36 +1,3 @@
(defun filejournal ()
"Refile heading to specific file based on heading (journal edition)"
(interactive)
(setq orgheading (org-get-heading))
(setq orgyear (substring orgheading 0 4))
(setq orgmonth (substring orgheading 5 7))
(setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org"))
(org-edit-headline "journal")
(let ((org-refile-targets '((orgfilepath :maxlevel . 1))))
(org-refile)))
(defun filediscord ()
"Refile heading to specific file based on heading (discord edition)"
(interactive)
(setq orgheading (org-get-heading))
(setq orgyear (substring orgheading 0 4))
(setq orgmonth (substring orgheading 5 7))
(setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org"))
(org-edit-headline "discord")
(let ((org-refile-targets '((orgfilepath :maxlevel . 1))))
(org-refile)))
(defun filemusic ()
"Refile heading to specific file based on heading (music edition)"
(interactive)
(setq orgheading (org-get-heading))
(setq orgyear (substring orgheading 0 4))
(setq orgmonth (substring orgheading 5 7))
(setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org"))
(org-edit-headline "music")
(let ((org-refile-targets '((orgfilepath :maxlevel . 1))))
(org-refile)))
(defun filedate ()
"Insert timestamp if required based on file name"
(interactive)
@ -41,3 +8,48 @@
(org-ctrl-c-ctrl-c)
(insert "\n\n")
(goto-char (point-min))))
(defun filejournal ()
"Refile heading to specific file based on heading (journal edition)"
(interactive)
(setq orgheading (org-get-heading))
(setq orgyear (substring orgheading 0 4))
(setq orgmonth (substring orgheading 5 7))
(setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org"))
(setq orgbuffername (concat orgheading ".org"))
(org-edit-headline "journal")
(let ((org-refile-targets '((orgfilepath :maxlevel . 1))))
(org-refile))
(with-current-buffer orgbuffername
(filedate)
(write-file orgbuffername)))
(defun filediscord ()
"Refile heading to specific file based on heading (discord edition)"
(interactive)
(setq orgheading (org-get-heading))
(setq orgyear (substring orgheading 0 4))
(setq orgmonth (substring orgheading 5 7))
(setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org"))
(setq orgbuffername (concat orgheading ".org"))
(org-edit-headline "discord")
(let ((org-refile-targets '((orgfilepath :maxlevel . 1))))
(org-refile))
(with-current-buffer orgbuffername
(filedate)
(write-file orgbuffername)))
(defun filemusic ()
"Refile heading to specific file based on heading (music edition)"
(interactive)
(setq orgheading (org-get-heading))
(setq orgyear (substring orgheading 0 4))
(setq orgmonth (substring orgheading 5 7))
(setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org"))
(setq orgbuffername (concat orgheading ".org"))
(org-edit-headline "music")
(let ((org-refile-targets '((orgfilepath :maxlevel . 1))))
(org-refile))
(with-current-buffer orgbuffername
(filedate)
(write-file orgbuffername)))