Navi2ch for Emacs (Part 11)

このエントリーをはてなブックマークに追加
エラーチェックを全くしてないけど。
(defun navi2ch-article-show-image ()
(interactive)
(save-excursion
(let ((url (get-text-property (point) 'url)))
(when url
(let* ((image (string-as-unibyte (navi2ch-net-get-content
(navi2ch-net-download-file url))))
(thum (with-temp-buffer
(set-buffer-multibyte nil)
(insert image)
(call-process-region (point-min) (point-max)
"convert" t t nil
"-sample" "200x100" "-" "-")
(buffer-string)))
(buffer-read-only nil))
(forward-line)
(insert-image (create-image thum nil t))
(put-text-property (1- (point)) (point)
'help-echo
(propertize "[image]" 'display
(create-image image nil t)))
(insert "\n"))))))