Is it possible to ask org mode to report a list of TODO items that I worked on over a period of time?
We can assume that for each Todo entry I have a time tag, e.g. <2014-03-13 Thu 17:04>
A quick way is to look at the logbook in the Agenda.
You can look at the agenda (see Agenda Views in Org Mode docs). Move the agenda to the time period you want - day, week, month, year. Put it in logbook mode (via the 'l' key, described in section 10.5 Commands in the agenda buffer). This will show for that time period which tasks you worked on and when.
You can also use a clock table (see section 8.4.2 The clock table) to get a detailed report where you can set all the details of what you are interested in.
(Note: the section heading numbers I refer to are in Org-mode version 8.2.5h - your version may differ, but those sections will still be there)
I use these agenda views to create daily, weekly and monthly reviews. Everything with a time stamp in the given period is listed, even archived stuff. It also adds a clock table to the bottom and will export to to html files when you export your agenda views (with C-c a e).
;; define "R" as the prefix key for reviewing what happened in various
;; time periods
(add-to-list 'org-agenda-custom-commands
'("R" . "Review" )
)
;; Common settings for all reviews
(setq efs/org-agenda-review-settings
'((org-agenda-files '("~/org/notes.org"
"~/org/projects.org"
))
(org-agenda-show-all-dates t)
(org-agenda-start-with-log-mode t)
(org-agenda-start-with-clockreport-mode t)
(org-agenda-archives-mode t)
;; I don't care if an entry was archived
(org-agenda-hide-tags-regexp
(concat org-agenda-hide-tags-regexp
"\\|ARCHIVE"))
))
;; Show the agenda with the log turn on, the clock table show and
;; archived entries shown. These commands are all the same exept for
;; the time period.
(add-to-list 'org-agenda-custom-commands
`("Rw" "Week in review"
agenda ""
;; agenda settings
,(append
efs/org-agenda-review-settings
'((org-agenda-span 'week)
(org-agenda-start-on-weekday 0)
(org-agenda-overriding-header "Week in Review"))
)
("~/org/review/week.html")
))
(add-to-list 'org-agenda-custom-commands
`("Rd" "Day in review"
agenda ""
;; agenda settings
,(append
efs/org-agenda-review-settings
'((org-agenda-span 'day)
(org-agenda-overriding-header "Day in Review"))
)
("~/org/review/day.html")
))
(add-to-list 'org-agenda-custom-commands
`("Rm" "Month in review"
agenda ""
;; agenda settings
,(append
efs/org-agenda-review-settings
'((org-agenda-span 'month)
(org-agenda-start-day "01")
(org-read-date-prefer-future nil)
(org-agenda-overriding-header "Month in Review"))
)
("~/org/review/month.html")
))
Related
Is it possible to ask org mode to report a list of TODO items that I worked on over a period of time?
We can assume that for each Todo entry I have a time tag, e.g. <2014-03-13 Thu 17:04>
A quick way is to look at the logbook in the Agenda.
You can look at the agenda (see Agenda Views in Org Mode docs). Move the agenda to the time period you want - day, week, month, year. Put it in logbook mode (via the 'l' key, described in section 10.5 Commands in the agenda buffer). This will show for that time period which tasks you worked on and when.
You can also use a clock table (see section 8.4.2 The clock table) to get a detailed report where you can set all the details of what you are interested in.
(Note: the section heading numbers I refer to are in Org-mode version 8.2.5h - your version may differ, but those sections will still be there)
I use these agenda views to create daily, weekly and monthly reviews. Everything with a time stamp in the given period is listed, even archived stuff. It also adds a clock table to the bottom and will export to to html files when you export your agenda views (with C-c a e).
;; define "R" as the prefix key for reviewing what happened in various
;; time periods
(add-to-list 'org-agenda-custom-commands
'("R" . "Review" )
)
;; Common settings for all reviews
(setq efs/org-agenda-review-settings
'((org-agenda-files '("~/org/notes.org"
"~/org/projects.org"
))
(org-agenda-show-all-dates t)
(org-agenda-start-with-log-mode t)
(org-agenda-start-with-clockreport-mode t)
(org-agenda-archives-mode t)
;; I don't care if an entry was archived
(org-agenda-hide-tags-regexp
(concat org-agenda-hide-tags-regexp
"\\|ARCHIVE"))
))
;; Show the agenda with the log turn on, the clock table show and
;; archived entries shown. These commands are all the same exept for
;; the time period.
(add-to-list 'org-agenda-custom-commands
`("Rw" "Week in review"
agenda ""
;; agenda settings
,(append
efs/org-agenda-review-settings
'((org-agenda-span 'week)
(org-agenda-start-on-weekday 0)
(org-agenda-overriding-header "Week in Review"))
)
("~/org/review/week.html")
))
(add-to-list 'org-agenda-custom-commands
`("Rd" "Day in review"
agenda ""
;; agenda settings
,(append
efs/org-agenda-review-settings
'((org-agenda-span 'day)
(org-agenda-overriding-header "Day in Review"))
)
("~/org/review/day.html")
))
(add-to-list 'org-agenda-custom-commands
`("Rm" "Month in review"
agenda ""
;; agenda settings
,(append
efs/org-agenda-review-settings
'((org-agenda-span 'month)
(org-agenda-start-day "01")
(org-read-date-prefer-future nil)
(org-agenda-overriding-header "Month in Review"))
)
("~/org/review/month.html")
))
I have thousands of headings in org-mode agenda files and use this structure for a long time. I want to set up org-mode so that it has a voting system. I press a hotkey, org-mode adds +1 to a heading and then I can filter the headings by the number of votes.
Upd. I have to clarify the question. I can see how this can be done:
* heading
:PROPERTIES:
:VOTES: 5
:END:
1) property drawers are searchable http://orgmode.org/worg/org-tutorials/advanced-searching.html, so I can use the comparison operators for filtering, e.g. VOTES>4.
2) I can use the propertу API http://orgmode.org/manual/Using-the-property-API.html for increasing and decreasing the counter.
Here is the solution. I add + to a speed command in org-mode. You could also bind this to some key.
(defun plusone ()
"Increase the VOTES property in an org-heading by one. Create
the property if needed."
(interactive)
(org-entry-put
(point)
"VOTES"
(format "%s" (+ 1 (string-to-number
(or
(org-entry-get (point) "VOTES")
"0"))))))
(add-to-list 'org-speed-commands-user '("+" . (plusone)))
I use the Org-Mode diary to keep a record of my upcoming appointments.
In my diary.org file I could have an entry that looks something like the following:
*** 2014-10-31 Friday
**** 9:30 Take dog to vet
<2014-10-31 Fri>
Now imagine I need to reschedule my vet appointment. Is there a quick way (i.e. some Org-Mode command) to refile the appropriate heading within the same file but under a different date?
I don't see a builtin function that does this, but it sounds pretty useful. This function is really just a simplification of the code in org-archive.el that archives to datetrees. If you instead want to refile based on SCHEDULED, DEADLINE or some other property, just change "TIMESTAMP" to the property you want.
(defun org-refile-to-datetree ()
"Refile a subtree to a datetree corresponding to it's timestamp."
(interactive)
(let* ((datetree-date (org-entry-get nil "TIMESTAMP" t))
(date (org-date-to-gregorian datetree-date)))
(when date
(save-excursion
(org-cut-subtree)
(org-datetree-find-date-create date)
(org-narrow-to-subtree)
(show-subtree)
(org-end-of-subtree t)
(newline)
(goto-char (point-max))
(org-paste-subtree 4)
(widen)
)
)
))
Use org-refile with C-c C-w. This will allow you to refile it to the rescheduled date. Also be sure to check out the variables org-refile-use-outline-path (nil by default) and org-outline-path-complete-in-steps.
I would also recommend using the full power of org-mode dates so they show up in the agenda (C-a) appropriately. For example:
* Take Dog to Vet
<2014-10-31 Fri 09:30>--<2014-10-31 Fri 10:30>
Using Emacs Org-mode synchronised with Toodledo I have the variable org-todo-keywords set to
((sequence "TODO" "NEXT" "|" "DONE")
(sequence "WAITING" "HOLD" "SOMEDAY" "|" "CANCELLED"))
When want the built-in agenda view weekly/daily agenda by typing C-c a a I get all task that is not in the todo state DONE.
How can I set Org-mode making the command C-c a a only return tasks of todo states TODO and NEXT?
Of cause I can make a custom agenda view but I guess there is a variable that limits the todo states or an other simple way of modifying org-mode setting the built-in agenda view to fulfil my needs.
Thanks in advance
Here is just one solution -- there are others:
(org-agenda-skip-entry-if 'notregexp "regular expression")
http://orgmode.org/manual/Special-agenda-views.html
see also
http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html
Other settings that include filtering out completed tasks for deadline and scheduled are as follows:
(org-agenda-skip-scheduled-if-done t)
(org-agenda-skip-deadline-if-done t)
EDIT (April 26, 2014): Included working example:
(setq org-agenda-custom-commands '(
("1" "Events" agenda "my-calendar" (
(org-agenda-span 365)
(org-agenda-show-all-dates nil)
(org-agenda-entry-types '(:deadline))
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'notregexp "\\* TODO\\|\\* NEXT"))
(org-deadline-warning-days 0) ))))
In my .emacs file, I have the variable setting '(org-log-refile (quote time)). This means that when I refile something with C-c C-w, an inactive timestamp is added, for example:
* TODO a task
- Refiled on [2013-10-13 Sun 15:17]
When I am in an org-mode calendar agenda view, hitting l (that's a lower-case L, not a 1) triggers org-agenda-log-mode. This means that I see clocked items added to my agenda. However, I do not see refiled items, which is not what I would expect. For what it may be worth, I already have the following variable setting in my .emacs file as well: '(org-agenda-log-mode-items (quote (closed clock state)))
So, how do I get refiled items to appear on my agenda when in org-agenda-log-mode?
You need to set org-agenda-include-inactive-timestamps to 't
Either by (setq org-agenda-include-inactive-timestamps 't) or by adding it ot your org-agenda-custom-commands as one of the options, e.g.:
(agenda ""
((org-agenda-span 'day)
(org-agenda-include-inactive-timestamps 't)))
Adding this as part of org-agenda-custom-commands makes the variable let-bound. It will only apply to the current agenda and not set as a default. If you want it set as a default for all agenda commands you can use the following:
(setq org-agenda-include-inactive-timestamps 't)