昨日から女房と子供たちは東京に帰省している。というわけで、只今ダンと二人?でまったり中。
金曜日の宴会でのこと。実家が雲仙にある酒蔵って方が今年の新酒三種類を持ってきて試飲させていただいた。九州の日本酒って飲むのは初めてだが、ごくごく普通にとってもおいしかった。
やっぱりぼくは焼酎より日本酒の方が好きだなぁと再確認した夜。
;; Google Mobile Proxy
(defvar w3m-use-google-proxy nil
"*Non-nil means use Google Mobile Proxy.")
(defvar w3m-google-proxy-uri "http://www.google.com/gwt/n?u=")
(defvar w3m-google-proxy-uri-regex
(concat "^" (regexp-quote w3m-google-proxy-uri)))
(defvar w3m-google-proxy-page-regex "&_gwt_pg=[0-9]+$")
(add-hook 'w3m-mode-hook
(lambda ()
(define-key w3m-mode-map "\M-p" 'w3m-toggle-use-google-proxy)))
(add-hook 'w3m-display-hook 'w3m-google-proxy-add-next)
(defun w3m-toggle-use-google-proxy (&optional redisp)
(interactive "P")
(setq w3m-use-google-proxy (not w3m-use-google-proxy))
(save-excursion
(dolist (buf (w3m-list-buffers))
(set-buffer buf)
(if w3m-use-google-proxy
(setcar mode-line-buffer-identification "[GMP]%b ")
(setcar mode-line-buffer-identification "%b "))))
(if redisp (w3m-redisplay-this-page))
(message "Google Mobile Proxy: %s"
(if w3m-use-google-proxy
(propertize "使う" 'face 'bold)
(propertize "使わない" 'face 'italic))))
(defun w3m-google-proxy-uri-normalize (url)
"Normalize URI of Google Mobile Proxy."
(when (string-match w3m-google-proxy-uri-regex url)
(setq url (w3m-url-decode-string (substring url (match-end 0))
w3m-current-coding-system))
(cond
((string-match w3m-google-proxy-page-regex url)
(setq url (substring url 0 (match-beginning 0))))
((string-match "&_gwt_[^=]+=[0-9]+$" url)
(setq url (substring url 0 (match-beginning 0)))
(while (string-match "&_gwt_[^=]+=[0-9]+$" url)
(setq url (substring url 0 (match-beginning 0)))))))
url)
(defadvice w3m-buffer-setup (after use-google-mobile-proxy activate)
(when w3m-use-google-proxy
(setcar mode-line-buffer-identification "[GMP]%b ")))
(defadvice w3m-uri-replace (after use-google-mobile-proxy activate)
(let ((url ad-return-value))
(if w3m-use-google-proxy
(when (and (string-match "^https?://" url)
(not (and
w3m-current-url
(string-match w3m-google-proxy-uri-regex w3m-current-url)))
(not (string-match w3m-google-proxy-uri-regex url)))
(setq ad-return-value
(format "%s%s" w3m-google-proxy-uri url)))
(setq ad-return-value (w3m-google-proxy-uri-normalize url)))))
(defun w3m-google-proxy-add-next (url)
"Get next/previous URI with Google Mobile Proxy."
(when (string-match w3m-google-proxy-uri-regex url)
(save-excursion
(let ((gmpreg (concat w3m-google-proxy-uri-regex
".+"
w3m-google-proxy-page-regex))
url)
(goto-char (point-min))
(setq w3m-previous-url
(catch 'previous
(while (search-forward "前のページ" nil t)
(forward-char -1)
(setq url (w3m-anchor))
(when (and url (string-match gmpreg url))
(throw 'previous url)))))
(setq w3m-next-url
(catch 'next
(while (search-forward "次のページ" nil t)
(forward-char -1)
(setq url (w3m-anchor))
(when (and url (string-match gmpreg url))
(throw 'next url)))))))))
初めて使ってみた。Firefox が必要にして十二分なので、常用はしないと思うが、Opera よりは馴染めそうかも。extension(?)/plug in(?)を揃えれば Firefox に取って代われるかも。