4 ms·
> 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!
by geospeck 7y ago
> 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!
- giansegato 7y agoUpvoted. Trying to setup that as well
- e19293001 7y agoI had been following some of the set-up from "Org Mode - Organize Your Life In Plain Text!"[0]. [0] - http://doc.norang.ca/org-mode.html http://doc.norang.ca/org-mode.html
- markc 7y agoThis isn't exactly what was asked for, but because I live in emacs I don't get much value being able invoke it from the command line. If that's ok, try this.. (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.
- qorrect 7y agoLove this. Running it outside of the file though is truncating my file though ?
- kabdib 7y agoI actually work in Windows, and use an Emacs clone called Epsilon, so my tiny batch file and Eel-language customization probably won't help you. It's really just a few minutes of work in any event.