Advantage of clocking

org-mode提供了计时(clocking)功能,使用方法是:

  • 为某项任务开始计时,使用C-c C-x C-i,或者在*Org Agenda*下使用I
  • 结束计时使用C-c C-x C-o,或者在*Org Agenda*下使用O

对一项任务可以多次计时。

计时工作本身比较枯燥,然而利用计时的结果,我们可以做很多深入的分析,org-mode提供两种方式展示分析结果。

  • *Org Agenda*下使用R,会在buffer底部生成一个表格,统计出当前*Org Agenda*周期内的任务消耗时间。
  • *Org Agenda*下使用l,会显示出在某个时间段内的工作内容。

有了这两个数据,我们可以分析出到底每天花了多少时间用在真真正正做事情上,有多少时间片段没有任何实际内容。

奇特的一生》里介绍柳比歇夫一生都在严格地计时,然后手工做总结、统计。有了org-mode的自动化功能,我们可以让这一过程更有趣。

Big Chinese Small ASCII

GNU Emacs有一个假设,即一个汉字字符的宽度是一个ASCII的两倍。如果这个假设不满足,就会有些功能看起来不正常,比如auto-fill-modeorg-mode table。很遗憾,缺省情况下,这个假设并不成立。

查看字体使用C-u C-x =,注意其中xft的值,通常来说,ASCII和中文的字体大小是一样的。以下是我的缺省字体设置:

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "#ffffff"
                :foreground "#000000" :inverse-video nil :box nil
                :strike-through nil :overline nil :underline nil
                :slant normal :weight normal :height 170
                :width normal :foundry "Ascender Corp."
                :family "Liberation Mono")))))

使用如下方法可以将汉字宽度设置为ASCII的两倍,具体数值需要参考相应的缺省配置。

(set-fontset-font "fontset-default" 'chinese-gbk "AR PL UKai CN 20")

如果是Emacs daemon,则需要写成:

(if (and (fboundp 'daemonp) (daemonp))
    (add-hook 'after-make-frame-functions
              (lambda (frame)
                (with-selected-frame frame
                  (set-fontset-font "fontset-default"
                                    'chinese-gbk "AR PL UKai CN 20"))))
  (set-fontset-font "fontset-default" 'chinese-gbk "AR PL UKai CN 20"))

这种方法的缺点是汉字很大、英文较小。