Report of completed Repeated Tasks in Orgmode - emacs

In orgmode, I am able to get the list of tasks completed for the month by having a custom command like
(add-to-list 'org-agenda-custom-commands
'("rm" "Current Month review"
agenda ""
((org-agenda-span 'month)
(org-agenda-show-all-dates t)
(org-agenda-start-with-clockreport-mode t)
(org-agenda-archives-mode t)
(org-agenda-start-day "01")
(org-read-date-prefer-future nil)
(org-agenda-start-with-log-mode t)
(org-agenda-overriding-header "Month in Review")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'nottodo 'done))
)))
The above command skips the repeated tasks since the current state is "TODO", even though it has a LOGBOOK with dates
. eg
:LOGBOOK:
- State "DONE" from "TODO" [2017-05-07 Sun 20:55]
- State "DONE" from "TODO" [2017-04-07 Fri 22:42]
:END:
Is there any solution to include completed repeated tasks also in the report...

Related

emacs 28.1 'parse-time-weekdays' - weekdays configuration doesn't working

Before Emacs 28.1 (Linux) I used:
(eval-after-load 'parse-time
'(progn
(setq parse-time-weekdays (nconc parse-time-weekdays
'(("so" . 0) ("mo" . 1) ("di" . 2) ("mi" . 3) ("do" . 4) ("fr" . 5) ("sa" . 6)))))
which gives german weekdays when entering org-mode dates, like <2022-08-21 So>, now I'am getting <2022-08-21 Sun> (Org mode version 9.5.4).
Why?

How to change different org-roam-capture-dailies-template by working days or weekend?

I have a template, and it works fine. Now I just wonder if there is a way to use A template in working days and use B template in weekend.
(setq org-roam-dailies-capture-templates
`(("d" "default" entry "* %<%H:%M:%S> \n %? \n\n"
:if-new (file+head "%<%Y-%m-%d>.org"
,(concat "#+title: %<%Y-%m-%d>\n"
"\n"
"%<%Y-%m-%d %A %W weeks %j days>\n"
"\n"
"*Don't ignore your dreams; don't work too much; say what you think; cultivate friendships; be happy*\n"
"\n"
))
:unnarrowed t)))

How to use a organized schedule in 4 agendas inside org (emacs)

Is there something already coded for ORG (emacs) something that helps to create the Eisenhower Matrix?
I know that can be done in the agenda creating 4 different files, or with some work, but it's possible to use the agenda of the ORG to separate them in 4 quadrants, like the image above?
I came up with this custom agenda command, that considers anything with priority A to be "important", and anything with a deadline within the next two days to be "urgent":
(add-to-list 'org-agenda-custom-commands
'("e" "Eisenhower matrix"
((tags-todo
"+PRIORITY=\"A\"+DEADLINE<=\"<+2d>\""
((org-agenda-overriding-header "Urgent (within 2 days) and important")))
(tags-todo
"+PRIORITY=\"A\"+DEADLINE>\"<+2d>\"|+PRIORITY=\"A\"-DEADLINE={.}"
((org-agenda-overriding-header "Important but not urgent")))
(tags-todo
"-PRIORITY=\"A\"+DEADLINE<=\"<+2d>\""
((org-agenda-overriding-header "Urgent (within 2 days) but not important")))
(tags-todo
"-PRIORITY=\"A\"+DEADLINE>\"<+2d>\"|-PRIORITY=\"A\"-DEADLINE={.}"
((org-agenda-overriding-header "Neither important nor urgent"))))
nil))
Using that, the following org-mode file:
* TODO [#A] This is important and urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#A] This is important but not urgent
DEADLINE: <2021-03-13 Sat>
* TODO This has no priority but is urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#B] This has medium priority but is urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#C] This has low priority but is urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#A] This is important but has no deadline
* TODO This has no priority and is not urgent
DEADLINE: <2021-03-13 Sat>
* TODO [#B] This has medium priority and is not urgent
DEADLINE: <2021-03-13 Sat>
* TODO [#C] This has low priority and is not urgent
DEADLINE: <2021-03-13 Sat>
* TODO This has no priority and no deadline
* TODO [#B] This has medium priority and no deadline
* TODO [#C] This has low priority and no deadline
looks like this:
Urgent (within 2 days) and important
test: TODO [#A] This is important and urgent
======================================================================================================================
Important but not urgent
test: TODO [#A] This is important but not urgent
test: TODO [#A] This is important but has no deadline
======================================================================================================================
Urgent (within 2 days) but not important
test: TODO This has no priority but is urgent
test: TODO [#B] This has medium priority but is urgent
test: TODO [#C] This has low priority but is urgent
======================================================================================================================
Neither important nor urgent
test: TODO This has no priority and is not urgent
test: TODO [#B] This has medium priority and is not urgent
test: TODO This has no priority and no deadline
test: TODO [#B] This has medium priority and no deadline
test: TODO [#C] This has low priority and is not urgent
test: TODO [#C] This has low priority and no deadline
Just to give an alternative way of organizing the tasks based only in the priorities... I like this because let me decide when to change the tasks category (not automatic using the DEADLINE):
;About the 2 elisp lines below: If you want to send items without explicit
;priorities to the bottom of the list you have to set org-default-priority to the
;value of org-lowest-priority). I did this to make recognize that: PRIORITY=0 are
;items without explicit priorities (not A, B or C, but just TODO)
(setq org-lowest-priority ?E)
(setq org-default-priority ?E)
(add-to-list 'org-agenda-custom-commands
'("e" "Eisenhower matrix"
((tags-todo
"+PRIORITY=\"A\""
((org-agenda-overriding-header "Urgent and important")))
(tags-todo
"+PRIORITY=\"B\""
((org-agenda-overriding-header "Important but not urgent")))
(tags-todo
"+PRIORITY=\"C\""
((org-agenda-overriding-header "Urgent but not important")))
(tags-todo
"+PRIORITY=0-PRIORITY=\"A\"-PRIORITY=\"B\"-PRIORITY=\"C\""
((org-agenda-overriding-header "Neither important nor urgent"))))
nil))
Using that, the following org-mode file:
* TODO [#A] This is important and urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#A] This is important but not urgent
DEADLINE: <2021-03-13 Sat>
* TODO This has no priority but is urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#B] This has medium priority but is urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#C] This has low priority but is urgent
DEADLINE: <2021-03-11 Thu>
* TODO [#A] This is important but has no deadline
* TODO This has no priority and is not urgent
DEADLINE: <2021-03-13 Sat>
* TODO [#B] This has medium priority and is not urgent
DEADLINE: <2021-03-13 Sat>
* TODO [#C] This has low priority and is not urgent
DEADLINE: <2021-03-13 Sat>
* TODO This has no priority and no deadline
* TODO [#B] This has medium priority and no deadline
* TODO [#C] This has low priority and no deadline
looks like this:
Urgent and important
refile: TODO [#A] This is important and not urgent: ver como adicionar os aniversários no ORG
refile: TODO [#A] This is important and urgent
refile: TODO [#A] This is important but not urgent
refile: TODO [#A] This is important but has no deadline
=============================================================================================================================
Important but not urgent
refile: TODO [#B] This has medium priority but is urgent
refile: TODO [#B] This has medium priority and is not urgent
refile: TODO [#B] This has medium priority and no deadline
=============================================================================================================================
Urgent but not important
refile: TODO [#C] This has low priority but is urgent
refile: TODO [#C] This has low priority and is not urgent
refile: TODO [#C] This has low priority and no deadline
=============================================================================================================================
Neither important nor urgent
refile: TODO This has no priority but is urgent
refile: TODO This has no priority and is not urgent
refile: TODO This has no priority and no deadline

How to loop through dates in Racket?

I want to loop through dates from the current date to some stop date, like the following example in Python:
import datetime
def count_dates(stop_date):
step = datetime.date.today()
while step >= stop_date:
yield step
step = step - datetime.timedelta(days=1)
def main():
for step in count_dates(datetime.date(2018, 1, 1)):
print(step.isoformat())
I don't see any date calculation functions in Racket, however. How can this be done?
If you want to use racket/date, you can accomplish your goal with find-seconds, seconds->date, current-seconds, and a simple arithmetic:
#lang racket
(require racket/date
racket/generator)
(define 1day (* 60 60 24))
(define (count-dates year month day)
(define target (find-seconds 0 0 0 day month year))
(in-generator
(let loop ([current (current-seconds)])
(when (>= current target)
(yield (seconds->date current))
(loop (- current 1day))))))
(date-display-format 'iso-8601)
(for ([dt (count-dates 2019 2 1)])
(displayln (date->string dt)))
This outputs:
2019-02-11
2019-02-10
2019-02-09
2019-02-08
2019-02-07
2019-02-06
2019-02-05
2019-02-04
2019-02-03
2019-02-02
2019-02-01
That is, from today (Feb 11, 2019) to Feb 1, 2019.
You can also use gregor or srfi-19 which are alternative date libraries that have a notion of time duration/difference.
Here is how you can do it using the date arithmetic provided by gregor. Specifically the +days and -days functions are helpful here:
#lang racket
(require gregor
racket/generator)
;; Date -> [Sequenceof Date]
(define (count-dates stop-date)
(in-generator
(let loop ([step (today)])
(when (date>=? step stop-date)
(yield step)
(loop (-days step 1))))))
(for ([step (count-dates (date 2018 1 1))])
(displayln (date->iso8601 step)))
And if you need something more general than "some number of days", there's also functions like +date-period and -date-period.

Org-mode : Custom agenda command TODO state change log without repeating same TODO

I use 'note and timestamp' on 'DONE' state change. In my custom agenda command I define that I want to see the state change log. But it appears that I still see the original repeating TODO. I would like to only see the state change log.
I have tried two different configurations. The first does not provide me the state change, the second provides the state change log but also repeats.
Any ideas how to trim the agenda to show only the state change log?
TODO entry in 'company.org':
* Agenda
** TODO Acronis : Backup Check :DAILY:
SCHEDULED:
:LOGBOOK:
- State "DONE" from "TODO" [2012-10-25 Thu 10:31] \\
Reverted 'proud' back to central storage. Asked about RAM upgrade. Scheduled for Monday.
:END:
:PROPERTIES:
:LAST_REPEAT: [2012-10-25 Thu 10:31]
:END:
TODO state change sequence:
;; '!' (for a timestamp) or '#' (for a note with timestamp)
(setq org-todo-keywords
'((sequence "TODO(t)" "PROJ(p)" "APPT(a)" "|" "DONE(d#)")))
Custom agenda command:
("c" agenda "Company 60"
(
(org-agenda-files '("~/shoebox/read/org/company.org"))
(org-agenda-ndays 60)
(org-deadline-warning-days 7)
(org-agenda-sorting-strategy '(time-up todo-state-up priority-down))
(org-agenda-time-grid nil)
(org-agenda-repeating-timestamp-show-all nil)
(org-agenda-show-log t)
(org-agenda-log-mode-items '(state))
(org-agenda-show-all-dates nil) ;; only show days with something
(org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":DAILY:"))
))
Produces:
60 days-agenda (W43-W51):
Thursday 25 October 2012
company: 10:00...... Scheduled: TODO Acronis : Backup Check :DAILY:
Where as:
("c" "Company 60"
((agenda ""))
(
(org-agenda-files '("~/shoebox/read/org/company.org"))
(org-agenda-ndays 60)
(org-deadline-warning-days 7)
(org-agenda-sorting-strategy '(time-up todo-state-up priority-down))
(org-agenda-time-grid nil)
(org-agenda-repeating-timestamp-show-all nil)
(org-agenda-show-log t)
(org-agenda-log-mode-items '(state))
(org-agenda-show-all-dates nil) ;; only show days with something
(org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":DAILY:"))
))
Produces:
60 days-agenda (W43-W51):
Thursday 25 October 2012
Company: 10:00...... Scheduled: TODO Acronis : Backup Check :DAILY:
Company: 10:31...... State: (DONE) TODO Acronis : Backup Check - Reverted 'proud' back to central storage. Asked about RAM upgrade. Scheduled for Monday. :DAILY: