org-modeでワールドカップもばっちり

org-mode用ワールドカップ試合スケジュール
きっとこれで大事な試合も見逃しません。


↓ソースは以下
worldcup games in your org-mode agenda
http://emacs-fu.blogspot.com/2010/06/worldcup-games-in-your-org-mode-agenda.html


手順

スケジュール表をダウンロード

fifa-worldcup-2010.org」として保存

$ curl -o fifa-worldcup-2010.org http://lists.gnu.org/archive/html/emacs-orgmode/2010-06/txtdncL72Jcr7.txt
org-agenda-filesに追加

.emacsに次の行を加える。

(add-to-list 'org-agenda-files "~/org/fifa-aworldcup-2010.org")

とりあえず、これで "M-x org-agenda a" でスケジュールが表示できる。



だがひとつ問題が。

時差の補正

日本は南アフリカより7時間早い。
つまり「fifa-worldcup-2010.org」の中の時間を7時間ほど遅らせる必要がある。
# もしくは南アフリカに行く。


一括で書き換える次の関数が便利。

(defun uphours (n)
  "update all timestamps n hours"
  (interactive "nAdd hours: ")
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward "[[<]" nil t)
      (when (org-at-timestamp-p t)
        (org-timestamp-change n 'hour)
        ))))

この関数を評価し、
fifa-worldcup-2010.org を開いた状態で M-x uphours する。
ミニバッファで「Add hours: 」と聞かれるので「7」と入力。
うまい具合に置換されます。


でもう一回 "M-x org-agenda a"


これで完璧!


うーん、どうやら時差のせいで試合中継見るの大変そうですねw
サッカーファンの方は頑張ってください。