reddit / emacs

org-journal: View history

johan_widen · 2022-09-08 09:36
I have for a while been wondering how I can get an overview of my org-journal entries. I would like to list all entries say for the last two months. Here is a way to do it: customize org-journal-search to do regexp search instead of plain string search. (customize-set-variable 'org-journal-search-forward-fn 're-search-forward) Then one can search for all entries for the last two months by executing `M-x org-journal-search` giving search string `"^\*\* "` and starting date `-2m` and end date the empty string (just hit return). Something to be aware of is that if one gives org-journal-search an empty search string, it will search for `"** "` which will not work as intended with regexp search. It is probably not a good idea to change the variable `org-journal-time-prefix` which defines that string. Just avoid entering an empty search string.
BobKoss · 2022-09-08 10:17
Would org-transclusion work here?
johan_widen · 2022-09-08 11:33
I believe that some simple elisp would be needed to translate the org-journal-search buffer lines into links understood by org-transclusion. The org-journal-search buffer is built up of lines of the form button heading The button is an emacs button, not a hyperlink. So it is just the text with some extra properties. The button needs to be translated to a file name or path name. The rest of the line will be used to specify the heading in that file: File link with ‘::\*heading’
[deleted] · 2022-09-08 14:47
[deleted]
johan_widen · 2022-09-08 15:27
Here is my attempt to support transclusion. Given that you already have a buffer "\*Org-journal search\*" with search results, put point in the buffer where you want the transclusions (not on the \*Org-journal search\* buffer). Then execute `M-x my-org-journal-search-result-to-transclude` Here is a link to the code: https://github.com/johanwiden/org-journal-search-result-to-transclude/blob/master/org-journal-search-result-to-transclude.el