orgのtableで日本語入れたときに崩れないようにするパッチ
超コネタ。あとで報告しとく。
--- org-table.el.orig 2009-10-28 00:30:10.000000000 +0900 +++ org-table.el 2010-02-01 22:44:15.384200000 +0900 @@ -818,7 +818,7 @@ (progn (setq s (match-string 1) o (match-string 0) - l (max 1 (- (match-end 0) (match-beginning 0) 3)) + l (max 1 (- (string-width o) 3)) e (not (= (match-beginning 2) (match-end 2)))) (setq f (format (if num " %%%ds %s" " %%-%ds %s") l (if e "|" (setq org-table-may-need-update t) ""))
mumamoを動かすのに最低限必要なもの
ふとmulti-modeが使いたくなったけど、mmm-modeがEmacs23で動かなかったからメモ。依存してるものが多すぎてnxhtmlをフルで入れるのは気が引ける。。
nxhtmlはhttp://ourcomments.org/cgi-bin/emacsw32-dl-latest.plの「Download latest nXhtml (zip file) 」から手に入れる
nxhtmlに入ってるもののうち、以下があればとりあえず動く。
- util/appmenu.el
- util/mlinks.el
- util/mumamo-aspnet.el
- util/mumamo-fun.el
- util/mumamo-regions.el
- util/mumamo-trace.el
- util/mumamo.el
- util/ourcomments-util.el
Eclimのコマンドのドキュメントをでっちあげる
eclimで色々遊んでみようと思ったら、eclimに渡す各種コマンドのドキュメントがないから、それを作るコマンドを作ってみた。せっかくだからgithubに置いてある。
http://github.com/buzztaiki/eclimdoc
使うときはこんな感じで。
$ ./eclimdoc eclim-source-dir
htmlで出すときはこんな感じ。
$ ./eclimdoc eclim-source-dir -Aformat=html
実行するとこんなのがでてくる
... ================ java_complete REQUIRED p project ARG REQUIRED f file ARG REQUIRED o offset ARG REQUIRED e encoding ARG REQUIRED l layout ARG ---------------- Command to handle java code completion requests. org.eclim.plugin.jdt.command.complete.CodeCompleteCommand /home/taiki/src/eclim/src/java/org/eclim/plugin/jdt/command/complete/CodeCompleteCommand.java ...
つか、javaのaptって初めて使ったけど、なんでaptなんて名前にしたんかね。faqにこんな事書いてるけど。。
Do you know about the Debian Advanced Packaging Tool?Yes.
bitbucketでwl-goodiesってのを作ってる
一応。報告。wanderlustをもうちょい便利にするためのユーティリティ集。です。あんまりドキュメントとか書いてないし、リリース予定もないからこっそりやってたんだけど、こっそりやり続けるのもよくないので晒しときます。あまりに整理されてないからWanderlustのMLで報告するのもためらってる。URLは以下。
http://bitbucket.org/buzztaiki/wl-goodies/
wl-goodiesが提供するのは
- wl-account: マルチアカウントをちょっと使いやすくする
- wl-alias-folder: フォルダに別名を付ける。複数のimapアカウントを使ってるときなんかに。
- wl-inline-forward: Windowsっぽいインラインフォワード
- wl-jit-highlight: draft で jit-highlight
- anything-wl: フォルダの選択を anythingで。
あと、いくつかリポジトリを公開してて
- chimaira: flim variant。limit と rfc2231-encoder を混ぜたやつ。未整理。
- enemy: semi variant。昔村田さんがemacs-mime ML に投げてた添付ファイルを別バッファに持つやつベース。未整理。
- elisp: 自分が EmacsWikiに公開してるやつ。
な感じ。あんまり期待しないで見てて下さいです。
個人的にはgitよりhgの方が好きだなぁ。なんて思ってる。こっちの方が分かりやすい。あと、githubだけじゃなくってbitbucketも案外いいよ。なんて宣伝してみる。
company.el の backend を auto-complete.el で使えるようにする ac-company.el を作った
ものは以下からどうぞ。
http://github.com/buzztaiki/auto-complete/blob/master/ac-company.el
install-elisp なら以下で。
M-x install-elisp http://github.com/buzztaiki/auto-complete/raw/master/ac-company.el
必要なもの
- 最新版のauto-complete
- company(http://nschum.de/src/emacs/company-mode/)
使い方
使い方は簡単。
- (ac-company-define-source NAME BACKEND) で company-backend を使う source を定義する。
- ac-sources に定義した source を追加する。
例えば company-elisp を使って補完がしたい場合は以下のように設定する。
(ac-company-define-source ac-source-company-elisp company-elisp) (add-hook 'emacs-lisp-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-company-elisp)))
company-css で補完するならこんな風に。
(ac-company-define-source ac-source-company-css company-css) (add-hook 'css-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-company-css)))
これで company の資産が使えるようになる。
ac-anything.elを最新のauto-completeで動くようにする
パッチつくったんで貼っときます。
オリジナルは以下から持ってきてくださいです。
http://www.emacswiki.org/cgi-bin/wiki/download/ac-anything.el
さて、EmacsWikiの方を更新してもらうのと、auto-completeの自分枝でメンテするのとどっちがいいだろう。
追記
ac-anything.elを更新 - http://rubikitch.com/に移転しましたでパッチを取り込んでもらった。というわけで以下のパッチはもう不要になった。
diff --git a/ac-anything.el b/ac-anything.el index 20e1e23..642368a 100644 --- a/ac-anything.el +++ b/ac-anything.el @@ -78,10 +78,11 @@ (require 'anything) (require 'anything-match-plugin nil t) (require 'auto-complete) +(require 'pulldown) (when (require 'anything-show-completion nil t) (use-anything-show-completion 'ac-complete-with-anything - '(length ac-prefix))) + '(length (anything-attr 'ac-prefix)))) (defun ac-complete-with-anything () "Select auto-complete candidates by `anything'. @@ -93,11 +94,12 @@ It is useful to narrow candidates." (defun anything-c-auto-complete-init () (anything-attrset 'ac-candidates ac-candidates) - (anything-attrset 'menu-width (ac-menu-width ac-menu)) + (anything-attrset 'menu-width (pulldown-width ac-menu)) + (anything-attrset 'ac-prefix ac-prefix) (ac-abort)) (defun anything-c-auto-complete-action (string) - (delete-backward-char (length ac-prefix)) + (delete-backward-char (length (anything-attr 'ac-prefix))) (insert string) (prog1 (let ((action (ac-get-candidate-property 'action string))) (if action (funcall action)))
auto-completeとbbdbでメールのアドレス補完する
欲しくなったから書いてみた。
必要なもの
- bbdb(http://bbdb.sourceforge.net/)
- 最新のauto-complete(http://github.com/m2ym/auto-complete)
- WanderlustとかのEmacsで動くMUA
設定
(defun wl-draft-turn-on-ac () (setq ac-sources '(ac-source-bbdb)) (auto-complete-mode 1)) (add-hook 'wl-draft-mode-hook 'wl-draft-turn-on-ac))
- 以下をどっかに書いとく
(defvar ac-bbdb-header-list '("to" "from" "cc" "bcc")) (defun ac-bbdb-candidate () (delete-dups (apply 'append (mapcar (lambda (rec) (mapcar (lambda (n) (bbdb-dwim-net-address rec n)) (bbdb-record-net rec))) (bbdb-records))))) (defun ac-bbdb-prefix () (interactive) (let ((case-fold-search t)) (when (and (< (point) (save-excursion (goto-char (point-min)) (search-forward (concat "\n" mail-header-separator "\n") nil t) (point))) (save-excursion (beginning-of-line) (while (and (looking-at "^[ \t]") (not (= (point) (point-min)))) (forward-line -1)) (looking-at (concat (regexp-opt ac-bbdb-header-list t) ":")))) (ac-prefix-symbol)))) (defvar ac-source-bbdb '((candidates . ac-bbdb-candidate) (match . substring) (prefix . ac-bbdb-prefix)))