ウィキテクノロジー(仮)のできるまで。
配布元のページから、
をダウンロードしてきて、load-pathの通った場所にコピーします。
~/.emacs に、下記のような内容を追記します。
;;; remember.el (autoload 'remember "remember" nil t) (autoload 'remember-region "remember" nil t) (define-key global-map [f8] 'remember) (define-key global-map [f9] 'remember-region) ;;; planner.el & emacs-wiki.el (load "planner.el")
※planner.el の中で、emacs-wiki.el を読み込んでいます。
各種ファイルを格納するためのディレクトリを作成。 場所や名前が気に入らない場合は、自由に変更できます。
~/Plans ‥‥‥ planner で使う全てのテキストを保存するディレクトリ
~/WebWiki ‥‥‥ publish でコンバートされた html ファイルが入るディレクトリ
※ WebWiki は ~/public_html/wiki へのシンボリックリンクにしてある。
これでおしまい。
Meadow での問題点と回避については EmacsWiki に移動しました。(2002.01.13)
customize機能を使っていろいろカスタマイズできます。1
M-x customize-group Customize gourp: (default emacs) emacs-wiki
だいたい次のようなところをいじっています。
(custom-set-variables
'(emacs-wiki-maintainer "mailto:cake-smd@ops.dti.ne.jp")
'(emacs-wiki-style-sheet
"<link rel=\"stylesheet\" type=\"text/css\" href=\"rubyStyle.css\">")
'(planner-publishing-markup
(quote
(["^#\\([A-C]\\)" 0 "- **\\1** "]
["^#\\([A-C][0-9]+\\)" 0 "- <a name=\"\\1\"/> **\\1** "]
["^\\.#\\([0-9]\\)" 0 "** <a name=\"\\1\" href=\"#\\1\">\\1:</a> "])))
'(emacs-wiki-meta-content "text/html;charset=sjis")
'(emacs-wiki-footer-date-format "%Y-%m-%d %T")
'(emacs-wiki-publishing-directory "/home/cake/WebWiki")
'(remember-handler-functions (quote (remember-append-to-planner))))
注: ~/.emacs の中で、planner.el をロードする前に custom-set-variables がないと、 planner が emacs-wiki を上書きする部分が有効にならないような気がします。 (‥‥‥と思い込んでましたが違いました。Thu Jan 10 23:20:26 2002 追記)
最後の remember-... は、remember.el を使って日記を書くための設定です。
書くと長くなるので省いたものは、
といったところ。
それから、ディフォルトでつけられるWikiNameへの色がちょっと見にくいので、
(custom-set-faces '(emacs-wiki-link-face ((t (:foreground "blue")))))としています。
あと、~/.emacs の中でいくつか emacs-wiki の関数を上書きするなどして 動作を変更しています。
(defun emacs-wiki-generate-index (&optional as-list exclude-private)
"Generate an index of all Wiki pages."
(let ((project emacs-wiki-current-project))
(with-current-buffer (get-buffer-create "*Wiki Index*")
(if project
(emacs-wiki-change-project project))
(let ((files (sort (copy-alist (emacs-wiki-file-alist))
(lambda (l r)
(let ((left-timestamp
(nth 5 (file-attributes (cdr l))))
(right-timestamp
(nth 5 (file-attributes (cdr r)))))
(if (= (car left-timestamp) (car right-timestamp))
(> (cadr left-timestamp) (cadr right-timestamp))
(> (car left-timestamp) (car right-timestamp)))))))
file)
(while files
(unless (and exclude-private
(emacs-wiki-private-p (caar files)))
(insert (if as-list "- " "") "[[" (caar files) "]] "
(format-time-string "%Y-%m-%d %T" (nth 5 (file-attributes (cdar files))))
"\n"))
(setq files (cdr files))))
(current-buffer))))
※消し忘れていた不要な一時変数(cake-pocket)を削除。(2002.01.15)
(defadvice emacs-wiki-publish (before force-publish-calendar ()) "Rebuild calendar page every time." (emacs-wiki-publish-files (list (concat planner-directory "/MyDiaryPages")) t)) (ad-activate 'emacs-wiki-publish)
(load-library "mhc-date.el")
(defun cake-wiki-calendar (&optional year month)
(interactive)
(let*
((yy (or year (ddate-yy (ddate-now))))
(mm (or month (ddate-mm (ddate-now))))
(from (list yy mm 1))
(to (ddate-mm-last-day from)))
(concat "Su||Mo||Tu||We||Th||Fr||Sa\n"
(let ((f
(lambda (n)
(if (> n 0)
(concat " |"
(funcall f (- n 1)))))))
(funcall f (ddate-ww from)))
(let ((fn
(lambda (d)
(if (ddate<= d to)
(concat
(if (emacs-wiki-page-file (ddate-to-s1 d "."))
(concat "[[" (ddate-to-s1 d ".") "]"
"[ " (ddate-dd-s d) "]]")
(ddate-dd-s d))
(if (= 6 (ddate-ww d)) "\n" "|")
(funcall fn (ddate-inc d)))))))
(funcall fn from)))))
※mhc の中の mhc-date.el が必要。
という感じ。
本来毎日のTODOやメモを管理するためのPIMアプリです。 EmacsWiki を拡張して作られているのでその機能を全て含みます。
XEmacsではなぜかTODOの部分がうまく動かないので使ってません。(2001.11.23)
‥‥‥でしたが、Emacs20 に乗り換えてからはちゃんと動くので使うようになりました。
それを補うために、毎日のファイルを作成するとき ~/diary ファイルからその日のスケジュールを拾ってきて、 追記しちゃうようにします。(2002.01.10)
;;; Planner に * Schedule を追加
;;; 内容は ~/diary から転記する
(defun planner-todays-appoints ()
(let ((diary-entries (diary)))
(if diary-entries
(mapconcat 'cadr diary-entries "\n")
"")))
(defun planner-goto-schedule ()
(interactive)
(let ((appo
(if (string-equal (buffer-name) (planner-today))
(planner-todays-appoints)
"")))
(goto-char (point-min))
(unless (re-search-forward "^\\* Schedule\n\n" nil t)
(re-search-forward "^\\* Notes")
(beginning-of-line)
(insert (concat "* Schedule\n\n" appo "\n\n"))
(forward-line -2))))
(defadvice plan (after insert-diary-entries activate)
"今日のファイルを開くと予定の部分に飛ぶ"
(planner-goto-schedule))
改善:今日以外のPlanファイルにも今日の予定を挿入するようになっていたので、 日付が違えば挿入しないように変更。(2002.01.16)
しかし ~/diary ファイルを閲覧専用と割り切って 別の予定管理ソフトか何かからデータを流し込んでくるというアプローチもあります。
(calendar+diaryという組合せは、そんなに高機能でもないし使い勝手もよくないので)
カレンダーを表示するたびに、別のデータを変換して反映するには、 こんな感じ。(2002.01.11)
(defadvice calendar (before remind-generate-diary activate)
"Generate a diary file from Outlook data."
(save-excursion
(with-current-buffer (find-file-noselect diary-file)
(erase-buffer)
(shell-command "/usr/home/bin/olconv" (current-buffer))
(save-buffer))))
"/usr/home/bin/olconv"の部分は自分の書いたスクリプトを入れる。 このolconvがどんなものかは RubyOnWindows を参照のこと。
;; This package extends emacs-wiki.el to act as a day planner, roughly ;; equivalent to the one used by *Franklin-Covey*. If they have patents ;; and trademarks and copyrights to prevent me even thinking in terms ;; of their methodology, then I can't believe they care at all about ;; productivity.
とあるのですが、"Franklin-Covey" が何かずっと謎でした。 最近教会の知り合いからフランクリン・プランナーについて教えてもらい、 また書籍「タイムクエスト」を借りて読んだところようやく判明しました。
日本法人のサイトです。
フランクリン・プランナーというシステム手帳の製品があるみたいですが、 独自サイズで一般のバイブルサイズと互換なし、という点や、 高級感を重視するデザイン・価格設定という商売っけがちょっとアレゲかも。
ユーザーさんのページです。 フランクリン・プランナーの概要がよくまとめ られています。
[1] 'planner-publishing-markup の customize-group が、'planner ではなく 'emacs-planner になっているため、customize-group で探してもみつかりません。 これは多分 typo と思われ。