>>562 regionがある場合って…、
一度C-SPCしたらreionは常にあるんじゃあ。
regionがあるサイズ以下ならそっから切り出す、
みたいな感じでどうよ?
(defvar google-current-word-max-region-size 20
"*検索単語を拾うとき、regionからの切り出しを行なう最大のサイズ。
検索単語をバッファから拾うときに、regionのサイズがこの値以下なら
regionの文字列を、それ以上なら`lookup-current-word'を使用する。")
;; 検索単語を拾う
(defun google-current-word ()
(let ((region-size (abs (- (point) (mark)))))
(if (and (not (zerop region-size))
(< region-size google-current-word-max-region-size))
(buffer-substring (point) (mark))
(lookup-current-word))))
(defun google-ja (str &optional module)
(interactive (list (read-string "Google search: " (google-current-word))))
(google str "&hl=ja&lr=lang_ja"))
(defun google-all (str &optional module)
(interactive (list (read-string "Google search: " (google-current-word))))
(google str ""))
おまけ
;; infoseek 辞書
(defun infoseek-jisyo (str)
(interactive (list (read-string "infoseek jisyo: " (google-current-word))))
(browse-url
(concat
"
http://jiten.www.infoseek.co.jp/Kokugo?pg=result_k.html&col=KO&qt="
(replace-in-string (google-encoding str) " +" "+")
"&sm=1")))