1

I liked the question and answer at emacs - org-mode: creation time range from effort estimate - Stack Overflow. It is regarding taking a scheduled item and effort estimate and producing a time range.

I wanted a slightly different result, but I can't see how to modify it (I imagine modifying to org-deadline would be easy). Instead of a Scheduled item, I wanted to act on simply a Timestamp.

In other words, (cutting, pasting and removing Scheduled: from the linked question),

* TODO Sample todo
  <2014-04-18 Fr 10:00>
  :PROPERTIES:
  :Effort:   1h
  :END:

would become

* TODO Sample todo
 <2014-04-18 Fr 10:00-11:00>
 :PROPERTIES:
 :Effort:   1h
 :END:

I considered org-time-stamp and org-add-planning-info, but with no success.

Assistance appreciated.

Community
  • 1
  • 1
Brady Trainor
  • 2,026
  • 20
  • 18
  • 1
    Here is the output of `org-element-at-point` using your sample todo: `"(headline (:raw-value TODO Sample todo :begin 915 :end 996 :pre-blank 0 :hiddenp nil :contents-begin 934 :contents-end 996 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :quotedp nil :EFFORT 1h :CATEGORY .scratch :title TODO Sample todo))"` It doesn't look like using a time-stamp without "scheduled" or without "deadline" is presently supported. The next comment is with the word `DEADLINE: ` preceding the time-stamp: – lawlist Apr 23 '14 at 05:16
  • 1
    `"(headline (:raw-value TODO Sample todo :begin 915 :end 1007 :pre-blank 0 :hiddenp nil :contents-begin 934 :contents-end 1007 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :quotedp nil :deadline (timestamp (:type active :raw-value <2014-04-18 Fr 10:00> :year-start 2014 :month-start 4 :day-start 18 :hour-start 10 :minute-start 0 :year-end 2014 :month-end 4 :day-end 18 :hour-end 10 :minute-end 0 :begin 947 :end 968 :post-blank 0)) :EFFORT 1h :CATEGORY .scratch :title TODO Sample todo))"` – lawlist Apr 23 '14 at 05:19
  • 1
    Therefore, without the word `DEADLINE: ` or `SCHEDULED: ` preceding the time-stamp, I do not believe your desired result can be achieved without substantially modifying org-mode -- e.g., `org-element.el`. Perhaps you could change the word `DEADLINE: ` or `SCHEDULED: ` to something else, e.g., `STATUTE:`, but you would still need something unique preceding the time-stamp so that `org-element.el` can do its magic. – lawlist Apr 23 '14 at 05:21
  • @lawlist, then I will try yours and Mathäus creation. But that is great, I am glad I encountered it! And thank you for the explanation. By the way, how do you execute `org-element-at-point`? I tried `M-: (org-element-at-point)` and checking `*Messages*`, but it is truncated with `...`. Do I need to understand `stout` for this one? Thank you! – Brady Trainor Apr 23 '14 at 06:01
  • 1
    For functions that contain an `(interactive)` statement near the beginning, you can use `M-x name-of-function`. For non-interactive functions (i.e., without the statement `(interactive)`), you can use `eval-expression`. When truncation occurs, you could use something like this: `(message "%s" (org-element-at-point))` at the beginning of the headline of the todo. – lawlist Apr 23 '14 at 06:41
  • @lawlist, thank you for the Emacs- and Org-fu. – Brady Trainor Apr 23 '14 at 14:34

0 Answers0