> it cracks open Emacs on the notes file, adds a timestamp, appends the optional text
Do you mind sharing how you have setup Emacs to do that? Thanks!
Do you mind sharing how you have setup Emacs to do that? Thanks!
(defvar org-journal-file "~/Dropbox/org/engjournal.org"
"Path to OrgMode journal file.")
(defvar org-journal-date-format "<%Y-%m-%d %a %I:%M %p>"
"Date format string for journal headings.")
(defun org-journal-entry ()
"Create a new diary entry for today or append to an existing one."
(interactive)
(switch-to-buffer (find-file org-journal-file))
(widen)
(let ((today (format-time-string org-journal-date-format)))
(beginning-of-buffer)
(unless (org-goto-local-search-headings today nil t)
((lambda ()
(org-insert-heading)
(insert today)
(insert " "))))
(beginning-of-buffer)
(org-show-entry)
(org-narrow-to-subtree)
(end-of-buffer)))
(global-set-key "\C-cj" 'org-journal-entry)
So, C-cj will open the file, create a timestamp entry at the top, and narrow to the subtree. Great for creating timestamped notes. I keep a journal this way (multiple entries per day are fine), but it could be used for any note taking.