elisp

elispでgoogle translate

google translate apiのversion2、REST形式を採用した。 (https://code.google.com/intl/ja/apis/language/translate/v2/using_rest.html) (defun wget (url) (shell-command-to-string (concat "/usr/bin/wget -q \"" url "\" -O -"))) (defun translate-pa…

elispでword count

就活のエントリーシートでwordcountが必要なときってよくある。 でもemacsのワードカウントコマンドってあるのかよく分からんかったので自分で作ってみた。 (defun wc (text) "word count" (length (apply 'concat (split-string text "[\s\n ]+")))) (defun…