Add functions for tracking music (performances and scrobbles)

master
trémeur 12 months ago
parent 5b16cd2480
commit d451b56eeb

@ -18,12 +18,12 @@
"Find or create heading for acquired books"
(filedate)
(goto-char (point-min))
(if (not (search-forward "** acquired" nil t))
(if (not (search-forward "** obtained" nil t))
(if (not (search-forward "* books" nil t))
(progn
(goto-char (point-max))
(insert "* books\n** acquired"))
(insert "\n** acquired"))))
(insert "* books\n** obtained"))
(insert "\n** obtained"))))
(defun findwatched ()
"Find or create heading for watched films"
@ -81,6 +81,26 @@
(setq visitend (read-string "End date (YYYY-MM-DD): " ))
(setq visitreturn (concat " <" visitstart ">--<" visitend ">")))
visitreturn)
(defun findperf ()
"Find or create heading for performances"
(filedate)
(goto-char (point-min))
(if (not (search-forward "* performances" nil t))
(progn
(goto-char (point-max))
(insert "* performances"))))
(defun setensemble ()
"Get the ensemble performed with"
(setq ensembles (s-split "\n" (f-read "~/Documents/drive/admin/emacs/ensembles.txt") t))
(setq theensemble (completing-read "Ensemble: " ensembles))
theensemble)
(defun setvenue ()
(setq venues (s-split "\n" (f-read "~/Documents/drive/admin/emacs/venues.txt") t))
(setq thevenue (completing-read "Venue: " venues))
thevenue)
(setq org-default-notes-file (concat "~/Documents/drive/org/journal/" (format-time-string "%Y/%m/%Y-%m-%d") ".org"))
@ -101,6 +121,10 @@
(file+function "" findwatched)
"* %^{Title} (%^{Year})%(therating)"
:jump-to-captured t)
("m" "Musical performance" entry
(file+function "" findperf)
"* %(setensemble)\n** %^{Performance name} (%(setvenue))\n%?"
:jump-to-captured t)
("p" "Visited place" entry
(file+function "" findvisited)
"* %^{Place}%(thevisitdate)"

@ -1,3 +1,14 @@
(defun filedate ()
"Insert timestamp if required based on file name"
(interactive)
(goto-char (point-min))
(unless (eq ?< (char-after))
(setq thedate (file-name-base))
(insert (concat "<" thedate ">"))
(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)
@ -5,9 +16,13 @@
(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)))
(org-refile))
(with-current-buffer orgbuffername
(filedate)
(write-file orgbuffername)))
(defun filediscord ()
"Refile heading to specific file based on heading (discord edition)"
@ -16,9 +31,13 @@
(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)))
(org-refile))
(with-current-buffer orgbuffername
(filedate)
(write-file orgbuffername)))
(defun filemusic ()
"Refile heading to specific file based on heading (music edition)"
@ -27,17 +46,10 @@
(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)))
(defun filedate ()
"Insert timestamp if required based on file name"
(interactive)
(goto-char (point-min))
(unless (eq ?< (char-after))
(setq thedate (file-name-base))
(insert (concat "<" thedate ">"))
(org-ctrl-c-ctrl-c)
(insert "\n\n")
(goto-char (point-min))))
(org-refile))
(with-current-buffer orgbuffername
(filedate)
(write-file orgbuffername)))

Loading…
Cancel
Save