Add functions for tracking music (performances and scrobbles)
This commit is contained in:
parent
5b16cd2480
commit
d451b56eeb
2 changed files with 72 additions and 36 deletions
|
@ -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,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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue