研究了一下beorg里自带的scheme interpreter 写了个clock-in和clock-out的功能
在org目录里创建一个init.org
文件 加入以下内容
#+BEGIN_SRC scheme
(set! editor-toolbar-show-in-mini #t)
(define (clock-in)
(insert ":LOGBOOK:\nCLOCK: \n:END:\n")
(goto-char (- (point) (string-length "\n:END:\n")))
(insert (date->string (current-date) "[~Y-~m-~d ~a ~H:~M]"))
(goto-char (+ (point) (string-length "\n:END:\n")))
)
(define (clock-out)
(insert (date->string (current-date) "--[~Y-~m-~d ~a ~H:~M]"))
(goto-char (point-max)))
(set! editor-toolbar-items '(("icon-time" (clock-in))
("icon-clock" (clock-out))
("icon-left" (backward-char))
("icon-right" (forward-char))
("icon-list" (insert "+ "))
("icon-change" (show-transform-commands))
("icon-settings" (insert-code-snippet))))
#+END_SRC