You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB
EmacsLisp

(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 ()
10 months ago
"Insert timestamp if required based on file name"
(interactive)
(goto-char (point-min))
10 months ago
(unless (eq ?< (char-after))
(setq thedate (file-name-base))
(insert (concat "<" thedate ">"))
(org-ctrl-c-ctrl-c)
(insert "\n\n")
(goto-char (point-min))))