emacs - 组织模式 : how to calculate dynamic deadlines

标签 emacs org-mode

我有一个任务的预定开始日期和完成任务的工作量,

例如,在 N=5 以下的情​​况下,开始日期为 <2016-01-27 星期三>

如何根据 scheduled_date+5days 自动计算截止日期?

最后我有以下内容:

DEADLINE: <2016-02-03 Wed> SCHEDULED: <2016-01-27 Wed>

最佳答案

下面的例子调用org-schedule;用户输入所需的日期/时间;然后将 5 天的时移添加到最后插入的时间戳,并且该值由 org-deadline 以编程方式使用。如果用户希望小时/分钟出现在截​​止日期的时间戳中,则将 with-hm 设置为 t

[如果用户希望截止日期与计划日期的时间完全相同,则需要做一些额外的工作。目前,截止日期默认为午夜。]

(defun schedule-me ()
(interactive)
  (org-schedule nil)
  (let* (
      (timeshift 5)
      (time
        (org-time-from-absolute
          (+
            timeshift
            (org-time-string-to-absolute org-last-inserted-timestamp))))
      (with-hm nil)
      (fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats)) )
    (org-deadline nil (format-time-string fmt time))))

关于emacs - 组织模式 : how to calculate dynamic deadlines,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32479979/

相关文章:

Emacs - 对 shell-command-on-region 的非交互式调用总是删除区域?

emacs - Emacs 中的模式局部变量

emacs - Jekyll 中使用 Org 模式的内部链接

windows - 从命令行调用 emacsclientw 的问题

html - Emacs 组织模式 HTML 脚注

emacs - Org-mode 在导出期间获取 src block 的内容

emacs - 使用emacs,如何交换2个窗口的位置

Emacs 插入居中的注释 block

emacs - auto-mode-alist 指定 ~ 的子目录

Emacs:从文件头禁用次要模式