组织模式:创建时间范围从努力估计 [英] org-mode: creation time range from effort estimate

查看:110
本文介绍了组织模式:创建时间范围从努力估计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用组态模式不是与GTD类似的系统,而是作为一个计划/调度程序,调度/时间戳捕获或复制的每个捕获的任务。在这样一个系统中,根据任务需要完成的预计持续时间,详细规划一天,包括特定的时间段可能是有利的。



可能在创建时间戳时从现有的努力估计属性生成时间框架?这将意味着,当a)调度被调用时,b)我不仅输入一个日期,而且还输入一个时间,c)存在一个努力属性,这个时间将根据所述属性自动变成一个时间框架。 >

关于如何实现这一点的一些提示将是足够的,我只是不知道足够的elisp开始。



在我的refile.org中捕获任务后,

编辑



将如下所示:

  * TODO样本todo 
:PROPERTIES:
:努力:1h
:END:

现在,当我重新加注我看它,并决定我会这样做,比如说,在
星期五上午10点:

  * TODO样本todo 
SCHEDULED:< 2014-04-18 Fr 10:00>
:财产:
:努力:1h
:END:

现在可以调用的函数将根据努力估计自动添加一个时间
范围:

  * TODO示例todo 
SCHEDULED:< 2014-04-18 Fr 10:00-11:00>
:财产:
:努力:1h
:END:

Edit2



请参阅下面的法律列表接受答案,以获取有力的解决方案

解决方案

要添加预定的时间戳,请使用: Mx组织计划



要添加努力作为现有时间戳的范围,使用标准的努力格式(例如,0 0:10 0: 30 1:00 2:00 3:00 4:00)[参见 http://orgmode.org/manual /Filtering_002flimiting-agenda-items.html ],以下功能应该做这个工作。 注意 org-mode 版本7使用全部小写的 org-element-property em>属性抽屉,而 org-mode 版本8使用所有大写字母 - 例如(org-element-property:EFFORT org-element-at-point))






使用以下示例任务已使用 org-mode 版本8.2.5.c进行测试 - 使用 h m 努力。 Emacs回合 00 01 02 03 04 05 06 07 08 09 0 1 2 3 4 5 6 7 8 9 和时间戳格式需要前者 - 因此,如果 10 ,我们需要将 0 code>。

  * TODO Sample todo 
SCHEDULED:< 2014-04-18 Fr 10: 00 GT;
:财产:
:努力:1:15
:END:






 (defun org-schedule-effort()
(interactive)
(save-excursion
(org-back-to-heading t)
(let *(
(element(org-element-at-point))
- 元素属性:EFFORT元素))
(已安排(组织元素属性:计划元素))
(ts-year-start(org-element-property:year-start scheduled))
(ts-month-start(org-element-property:month-start scheduled))
(ts-day-start(org-element-property:day-start scheduled))
ts-hour-start(org-element-property:hour-start scheduled))
(ts-minute-start(org-element-property:minute-start scheduled)))
nil(concat
(格式%sts-year-start)
-
(if(< ts-month-start 10)
(concat0 (格式% sts-month-start))
(格式%sts-month-start))
-
(if(< ts-day-start 10)
(concat0(格式%sts-day-start))
(格式%sts-day-start))

(if(< ts-hour-start 10)
(concat0(格式%sts-hour-start))
(格式%s ts-hour-start))

(if(< ts-minute-start 10)
(concat0(格式%sts-minute-start )
(格式%sts-minute-start))
+
努力)))))


I would like to use org-mode not with a GTD-like system but rather as a planner/scheduler, scheduling/timestamping every captured task on capture or refile. In such a system, detailed planning of a day including specific frames of times according to the estimated duration a task will take to get done, might be advantageous.

Would it be possible to generate a time frame from an existing effort estimate property when a timestamp is created? This would mean that, when a) scheduling is called and b) I enter not only a date but also a time and c) an effort property exists, this time will automatically be turned into a time frame according to said property.

Some hints as to how this could be achieved would be more than enough, I just do not know enough elisp to get started.

Edit

after capturing the task in my refile.org would look like this:

* TODO Sample todo
 :PROPERTIES:
 :Effort:   1h
 :END:

now when refiling I look at it and decide that I will do it, say, on Friday at 10am:

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

the function that could be called now would automatically add a time range according to effort estimate:

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

Edit2

See lawlists accepted answer below for a robust solution

解决方案

To add a scheduled timestamp, use: M-x org-schedule

To add effort as a range to an existing timestamp, using the standard effort format (e.g., "0 0:10 0:30 1:00 2:00 3:00 4:00") [see http://orgmode.org/manual/Filtering_002flimiting-agenda-items.html ], the following function should do the job. NOTE org-mode version 7 uses all lowercase for the org-element-property property drawer, whereas org-mode version 8 uses all capitals -- e.g., (org-element-property :EFFORT (org-element-at-point))


org-schedule-effort was tested with org-mode version 8.2.5.c using the following example task -- not using h or m for effort. Emacs rounds 00 01 02 03 04 05 06 07 08 09 to 0 1 2 3 4 5 6 7 8 9 and timestamp format requires the former -- therefore, we need to concatenate a 0 to the beginning if less than 10.

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


(defun org-schedule-effort ()
(interactive)
  (save-excursion
    (org-back-to-heading t)
    (let* (
        (element (org-element-at-point))
        (effort (org-element-property :EFFORT element))
        (scheduled (org-element-property :scheduled element))
        (ts-year-start (org-element-property :year-start scheduled))
        (ts-month-start (org-element-property :month-start scheduled))
        (ts-day-start (org-element-property :day-start scheduled))
        (ts-hour-start (org-element-property :hour-start scheduled))
        (ts-minute-start (org-element-property :minute-start scheduled)) )
      (org-schedule nil (concat
        (format "%s" ts-year-start)
        "-"
        (if (< ts-month-start 10)
          (concat "0" (format "%s" ts-month-start))
          (format "%s" ts-month-start))
        "-"
        (if (< ts-day-start 10)
          (concat "0" (format "%s" ts-day-start))
          (format "%s" ts-day-start))
        " "
        (if (< ts-hour-start 10)
          (concat "0" (format "%s" ts-hour-start))
          (format "%s" ts-hour-start))
        ":"
        (if (< ts-minute-start 10)
          (concat "0" (format "%s" ts-minute-start))
          (format "%s" ts-minute-start))
        "+"
        effort)) )))

这篇关于组织模式:创建时间范围从努力估计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆