繁体   English   中英

将注释列添加到emacs组织模式时钟表

[英]Add comment column to emacs org-mode clock table

我真的很想能够记录每个项目的评论,例如:

#+BEGIN: clocktable :maxlevel 3 :emphasize nil :scope file :block thisweek :properties ("COMMENT")
#+CAPTION: Clock summary at [2018-12-06 Thu 15:16], for week 2018-W49.
| Headline                         | Time   |      |  COMMENT  |
+----------------------------------+--------+------|-----------|
| *Total time*                     | *0:15* |      |           |
+----------------------------------+--------+------|-----------|
| task list                        | 0:15   |      |           |
| \_  First task                   |        | 0:06 | comment 1 |
| \_  Second task                  |        | 0:09 | comment 2 |
#+END: clocktable


* task list
** First task
   :PROPERTIES:
   :COMMENT: comment 1
   :LOGBOOK:
   CLOCK: [2018-12-06 Thu 13:35]--[2018-12-06 Thu 13:41] =>  0:06
   :END:
** Second task
   :PROPERTIES:
   :COMMENT: comment 2
   :LOGBOOK:
   CLOCK: [2018-12-06 Thu 13:41]--[2018-12-06 Thu 13:50] =>  0:09
   :END:

当我使用:properties ("COMMENT") ,会在时钟表中创建注释列,但它不会获得我在每个任务下编写的注释。 另外,comment列实际上是创建为第一列,而我希望它是最后一个列。 我似乎无法弄清楚该如何解决。

如何才能做到这一点?

原来我在:PROPERTIES:之后缺少了:END: :PROPERTIES:

   :PROPERTIES:
   :COMMENT: comment 1
   :END: <----- THIS IS WHAT WAS MISSING 

关于列的顺序,我在以下位置找到了帮助: https : //emacs.stackexchange.com/questions/42329/how-to-choose-the-order-of-clocktable-columns

解决方案是使用组织模式格式化程序并调用.emacs初始化文件中定义的函数。 要将我的COMMENT列移到最右边,这是我的.emacs文件:

(defun my-clocktable-write (&rest args)
  "Custom clocktable writer.
Uses the default writer but shifts the first column right."
  (apply #'org-clocktable-write-default args)
  (save-excursion
    (forward-char) ;; move into the first table field
    (org-table-move-column-right)
    (org-table-move-column-right)
    (org-table-move-column-right)
    (org-table-move-column-right)
    ))

在我的.org文件中,我使用:

#+BEGIN: clocktable :maxlevel 4 :scope file :block today-1 :properties ("Comment") :formatter my-clocktable-write
#+CAPTION: 

注意上面的:properties:formatter

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM