emacs org-mode repeat task before deadline - org-mode

I have some confusion on emacs org data and times.
For example:
** TODO study English
DEADLINE: <2013-05-17 Fri> SCHEDULED: <2013-05-14 Thu ++1d>
After 2013-05-17, I don't want to show this task again. but right now in agenda view, it shows:
Friday 17 May 2013
jtd: Deadline: TODO study English
Saturday 18 May 2013
jtd: Scheduled: TODO study English
Sunday 19 May 2013
jtd: Scheduled: TODO study English
How can I do this in org mode?

Related

orgmode logbook drawer total time not calculated as expected

I use the logbook drawer in a headline like this:
* WIP My Project
:LOGBOOK:
CLOCK: [2020-01-15 mer. 10:18]--[2020-01-15 mer. 11:18] => 1:00
CLOCK: [2020-01-14 mar. 10:12]--[2020-01-14 mar. 11:12] => 1:00
CLOCK: [2019-11-13 mer. 14:20]--[2019-11-13 mer. 14:50] => 0:30
:END:
When I ask for the total time (pressing C-c C-x C-d) I have 2:00 and not 2:30 as expected. The CLOCK entry of 2019 is excluded. I wonder why...
Any idea? Thanks in advance!
Try C-u C-u C-c C-x C-d. By default, org-clock-display uses the range set in org-clock-display-default-range, which defaults to thisyear.

diary-float query for Emacs Diary

In the Emacs manual the following is furnished as an example of a special entry in the Emacs Diary:
&%%(diary-float 11 4 4) American Thanksgiving
The 11 specifies the month, the first 4 specifies the day of the week (Thursday) and the second 4 the 4th Thursday of the month.
One can use t to indicate all months of the year, but how would one specify all Thursdays of the month? I have tried t and it does not work.
For example, let's say that every October I have to perform a duty, but not every day, only every Thursday. How would I capture that using a diary-float?
It's not possible to do this with diary-float, but as described in Sexp Entries in the Emacs manual, you can use an arbitrary Lisp expression in the diary file. This seems to work:
%%(let ((dayname (calendar-day-of-week date))
(month (car date)))
(and (= month 10) (= dayname 4))) It's a Thursday in October

org-habit shows no habits

I've posted before on using Brent Hansen's amazing org setup. This time around, I'm specifically having a problem with getting org-mode to display my habits.
I had to nuke my emacs and start from scratch recently, so debugging is hard.
I am quite certain that I have habit mode enabled since:
I have enabled in my .emacs (see below)
;; Enable habit tracking
(setq org-modules (quote (org-habit)))
; position the habit graph on the agenda to the right of the default
(setq org-habit-graph-column 50)
(run-at-time "06:00" 86400 '(lambda () (setq org-habit-show-habits t)))
My capture template for habits, seems to set up to include everything needed:
("h" "Habit" entry (file "~/Dropbox/org-new/refile.org")
"* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n")
I have an additional set of properties in my Top Level Header for habits that reads:
* Habits
:PROPERTIES:
:LOGGING: DONE(!)
:ARCHIVE: %s_archive::* Habits
:END:
When I run the agenda, I see (Org-Agenda Day Ddl Grid Habit Wrap) in the Mode line
Despite that, my habits do not show up, nor does a habit graph, when I run the agenda. I've trawled everything I can to try and solve this and I'm now at my wit's end. Any help would be greatly appreciated!
You need to add a :STYLE: property with the value habit to your habits:
** TODO Shave
SCHEDULED: <2009-10-17 Sat .+2d/4d>
- State "DONE" from "TODO" [2009-10-15 Thu]
- State "DONE" from "TODO" [2009-10-12 Mon]
- State "DONE" from "TODO" [2009-10-10 Sat]
- State "DONE" from "TODO" [2009-10-04 Sun]
- State "DONE" from "TODO" [2009-10-02 Fri]
- State "DONE" from "TODO" [2009-09-29 Tue]
- State "DONE" from "TODO" [2009-09-25 Fri]
- State "DONE" from "TODO" [2009-09-19 Sat]
- State "DONE" from "TODO" [2009-09-16 Wed]
- State "DONE" from "TODO" [2009-09-12 Sat]
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2009-10-19 Mon 00:36]
:END:
See Tracking your habits.
EDIT: While the STYLE:habit property is necessary, that isn't the problem in this case (as discussed in the comments). However, it might well be that the order of the elements in the headline is the problem. Running org-lint on the following example:
* NEXT Exercise
[2017-07-16 Sun 19:36]
[[file:~/Dropbox/org-new/todo.org::*Write][Write]]
SCHEDULED: <2017-07-16 Sun .+1d/2d>
:PROPERTIES:
:STYLE: habit
:REPEAT_TO_STATE: NEXT
:END:
I get
3 low Link to non-existent local file "~/Dropbox/org-new/todo.org"
4 low Misplaced planning info line
5 high Incorrect location for PROPERTIES drawer
If I reorg the file a bit to this:
* NEXT Exercise
SCHEDULED: <2017-07-16 Sun .+1d/2d>
:PROPERTIES:
:STYLE: habit
:REPEAT_TO_STATE: NEXT
:END:
[2017-07-16 Sun 19:36]
[[file:~/Dropbox/org-new/todo.org::*Write][Write]]
then the high priority warning disappears. I don't know whether that will make habits work, but I'm willing to bet that it would.
The manual states:
When they are associated with a single entry or with a tree they need to be inserted into a special drawer (see Drawers) with the name PROPERTIES, which has to be located right below a headline, and its planning line (see Deadlines and scheduling) when applicable.

Org-mode : estimating deadlines for parent headlines

I've never been fond of scheduling dates.
I cannot find a way to make org-mode to, given a bunch of tasks, subtasks and estimates, compute the deadline of each task and the parent tasks for me.
In my dream, I would say that I work 8 hours a day, and my week-days are Mo-Fr, and estimate tasks in hours, days and weeks.
Emacs would compute the dates for me, starting... now. Or starting at a schedule date.
Here is a question that could be on the path to my dream: org-mode: creation time range from effort estimate
Before
* Bunch of tasks
SCHEDULED: <2015-12-15 mar.>
** Substasks1
*** TODO task1
:PROPERTIES:
:Effort: 7:30
:END:
*** TODO task2
:PROPERTIES:
:Effort: 7:30
:END:
*** TODO task3
:PROPERTIES:
:Effort: 3:15
:END:
** Subtask2
*** TODO task4
:PROPERTIES:
:Effort: 0:30
:END:
*** TODO task5
:PROPERTIES:
:Effort: 3:15
:END:
*** TODO task6
:PROPERTIES:
:Effort: 7:30
:END:
*** TODO task7
:PROPERTIES:
:Effort: 15:00
:END:
After
* Bunch of tasks
DEADLINE: <2015-12-22 mar.> SCHEDULED: <2015-12-15 mar.>
** Substasks1
DEADLINE: <2015-12-17 jeu.>
*** TODO task1
DEADLINE: <2015-12-15 mar.>
:PROPERTIES:
:Effort: 7:30
:END:
*** TODO task2
DEADLINE: <2015-12-16 mer.>
:PROPERTIES:
:Effort: 7:30
:END:
*** TODO task3
DEADLINE: <2015-12-16 mer.>
:PROPERTIES:
:Effort: 3:15
:END:
** Subtask2
...

[org-mode]: repeating task in every Mon, Wed, Fri at 18:00, need help with sexp

As I had written in title, I need a little help with improvement of this sexp:
* TODO remeber about thingie.
SCHEDULED: <%%(or (= 1 (calendar-day-of-week date))
(= 3 (calendar-day-of-week date))
(= 5 (calendar-day-of-week date)))>
Now it shows itself in the following days, but I would like to change two things about it:
How can I also schedule on specific hours (i.e. 18:00 - 20:00) in the following days
How can I made this task repeat itself, just like it repeats itself with
<2010-05-13 Wed +1w>
(by repetition I mean something like it automatically logs the closing date and time and comes back to the TODO state).
I will be grateful for any help.
Thanks.
* TODO remeber about thingie.
SCHEDULED: <2012-05-07 Mon 18:00 +1w>
SCHEDULED: <2012-05-09 Wed 18:00 +1w>
SCHEDULED: <2012-05-11 Fri 18:00 +1w>
Unfortunately, you cannot use diary-sexps for repeating TODO items in org-mode like that.
The work-around is to create three repeating TODO items, and use the normal org-mode date expressions, not diary sexps.
If you don't need to mark task as DONE every day, you must simply write:
** remeber about thingie 1. 18:00-20:00
<%%(and (memq (calendar-day-of-week date) '(1 3 5))
(diary-block 03 26 2012 12 31 2012))>
In your case you have to use separated tasks:
** TODO remeber about thingie 2-1. 18:00-20:00
SCHEDULED: <2012-03-26 Mon +1w>
** TODO remeber about thingie 2-3. 18:00-20:00
SCHEDULED: <2012-03-28 Wed +1w>
** TODO remeber about thingie 2-5. 18:00-20:00
SCHEDULED: <2012-03-30 Fri +1w>
Marking task as DONE (C-c C-t) your task will be changed automatically to:
** TODO remeber about thingie 2-5. 18:00-20:00
SCHEDULED: <2012-04-06 Fri +1w>
- State "DONE" from "TODO" [2012-03-30 Fri 12:34]
:PROPERTIES:
:LAST_REPEAT: [2012-03-30 Fri 12:34]
:END: