Closed Zyrohex closed 4 years ago
sorry for the confusion. I will update the docs.
I am not using org mode at all. I'm using the old emacs diary that is independent of org mode and existed before it. The emacs diary uses the word "entry" in the same way I was using it, so I don't want to use a different word, but I'll provide more explanation and an example of a valid file.
I know there's an org-mode agenda and I know it can use a diary file, but I didn't know there was a way to read org events from the emacs diary. metrics-tracker is manually parsing the diary file (the file that the diary-file
variable points to), so I wouldn't expect it to find anything you put in an org-mode file. How did you get it to work?
Ah, well this looks like a conflict. So if you use org-agenda-diary you can add diary entries directly from org-agenda which puts it in orgmode format. But it works fine once you know what format it's looking for.
Example 1:
* Data-Tracker
2019-12-18 18:31 walking 6.89
2019-12-25 16:45 walking 7.34
But you can also stick the data in individual entries like such and metrics-tracker will still compile the data as you'd expect.
Example 2:
* 2019
** 2019-12 December
*** 2019-12-18 Wednesday
**** Jumped into the freezing cold river!
2019-12-18 13:21 swimming 30
*** 2019-12-21 Saturday
**** Olympic swimmer!
2019-12-21 11:08 swimming 89
And a capture template i've configured for orgmode.
(add-to-list 'org-capture-templates
'("dd" "Journal with Data" plain (file+olp"~/.gtd/diary.org" "Data Tracker")
"%<%Y-%m-%d> %<%H:%M> %^{activity|walking|running|calories|bicycle|eating out} %^{value}" :immediate-finish t))
Speaking of improving the docs, a date like 2020-01-01 isn't really ambiguous to help readers figure out which number represents a month, and which one a day.
I changed the example date and explicitly pointed to the diary-file
file, so it won't be confused with org-agenda.
@pbienst I still don't understand how metrics-tracker found your data. what is org-agenda-diary? is that the same as (setq org-agenda-include-diary t)
? does it copy content from org files into your diary file?
I don't use the vanilla emacs diary, but I used setq diary-file to point to the file where I log. It happens to be an org file with lots of other content.
@pbienst ah, that makes the parsing difficulties we saw more understandable. it didn't occur to me to do that, but it's good that it works (now).
@nmartin84 I've updated the doc. reopen if you think it's still unclear.
May want to include an example diary.org file or provide a little more detail what format it's looking for. When you pointed out that
I took diary entry as the headline format, and not the body. Orgmode capture templates use the term "entry" for new headline entries. I spent 30 minutes adjusting my headline entries before I finally tried moving it to the body section where it finally worked. This could lead to a lot of frustration for other users and may steer people away.
From the orgmode manual: