読者です 読者をやめる 読者になる 読者になる

Λάδι Βιώσας

http://profile.hatena.ne.jp/kenkitii/

howm

書き散らかしメモツール ― howm
Emacsで動くWikiもどき。多機能すぎる感じがしますが便利です。

以下、.emacsのメモ

;;; howm
(setq howm-menu-lang 'ja)
(global-set-key "\C-c,," 'howm-menu)
(mapc
 (lambda (f)
   (autoload f
     "howm-mode" "Hitori Otegaru Wiki Modoki" t))
 '(howm-menu howm-list-all howm-list-recent
             howm-list-grep howm-create
             howm-keyword-to-kill-ring))

;;; ファイルのサイズが0ならメモを消す
(if (not (memq 'delete-file-if-no-contents after-save-hook))
    (setq after-save-hook
      (cons 'delete-file-if-no-contents after-save-hook)))

(defun delete-file-if-no-contents ()
  (when (and
         (buffer-file-name (current-buffer))
         (= (point-min) (point-max)))
    (when (y-or-n-p "Delete file and kill buffer?")
      (delete-file
       (buffer-file-name (current-buffer)))
      (kill-buffer (current-buffer)))))

;; howm-menu の後 他の window を閉じる
(defadvice howm-menu (after close-other-window activate)
  (delete-other-windows))

;; howm-create の後 他の window を閉じる
(defadvice howm-create (after close-other-window activate)
  (delete-other-windows))