Skip to content

Instantly share code, notes, and snippets.

@syohex
Created December 7, 2011 08:15
Show Gist options
  • Save syohex/1441961 to your computer and use it in GitHub Desktop.
Save syohex/1441961 to your computer and use it in GitHub Desktop.
create daily memo to specified directory
;; create daily org memo file
(defun open-daily-file ()
(interactive)
(let* ((memodir (expand-file-name "~/memo/daily"))
(daily-path (concat memodir "/" (format-time-string "%Y/%m"))))
(unless (file-directory-p daily-path)
(make-directory daily-path t))
(let ((daily-file (concat daily-path "/" (format-time-string "%d.org"))))
(unless (file-exists-p daily-file)
(with-temp-file daily-file
(insert (format-time-string "%Y年 %m月 %d日"))))
(find-file daily-file))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment