簡體   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