[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:
初回のみ画像表示のトグ
ルに失敗します
From: KURODA Chihiro <chee@subdimension.com> さん曰く
Subject: [emacs-w3m:02384] Re: 初回のみ画像表示のトグルに失敗します
Message-ID: <m3vgfok0zo.wl@localhost>
Date: Mon, 03 Dec 2001 20:16:11 +0900
黒> 画像の形式が gif の場合に限るようです(png, jpg は OK)
このパッチで直ると思います。
indent が変ったのでパッチは長いけど、実質一行です。
--
白井秀行 (mailto:shirai@rdmg.mgcs.mei.co.jp)
Index: w3m-xmas.el
===================================================================
RCS file: /cvsroot/w3m-shirai/emacs-w3m/w3m-xmas.el,v
retrieving revision 1.62
diff -u -u -r1.62 w3m-xmas.el
--- w3m-xmas.el 2001/11/28 10:49:18 1.62
+++ w3m-xmas.el 2001/12/03 11:28:50
@@ -242,31 +242,33 @@
(if (not handler)
(w3m-process-with-wait-handler
(w3m-create-image url no-cache referer handler))
- (w3m-process-do-with-temp-buffer
- (type (condition-case err
- (w3m-retrieve url 'raw no-cache nil referer handler)
- (error (message "While retrieving %s: %s" url err) nil)))
- (when (w3m-image-type-available-p (setq type (w3m-image-type type)))
- (let ((data (buffer-string)))
- (or (and (eq type 'gif)
- (or w3m-should-unoptimize-animated-gifs
- w3m-should-convert-interlaced-gifs)
- w3m-gifsicle-program
- (w3m-fix-gif url data no-cache))
- (and (eq type 'xbm)
- (let (width height content)
- (with-temp-buffer
- (insert data)
- (goto-char (point-min))
- (if (re-search-forward "width[ \t]+\\([0-9]+\\)")
- (setq width (string-to-int (match-string 1))))
- (if (re-search-forward "height[ \t]+\\([0-9]+\\)")
- (setq height (string-to-int (match-string 1))))
- (while (re-search-forward "0x\\(..\\)" nil t)
- (setq content (cons (string-to-int (match-string 1) 16) content)))
- (setq content (concat (nreverse content))))
- (make-glyph (vector 'xbm :data (list width height content)))))
- (make-glyph (vector type :data data))))))))
+ (lexical-let ((url url)
+ (no-cache no-cache))
+ (w3m-process-do-with-temp-buffer
+ (type (condition-case err
+ (w3m-retrieve url 'raw no-cache nil referer handler)
+ (error (message "While retrieving %s: %s" url err) nil)))
+ (when (w3m-image-type-available-p (setq type (w3m-image-type type)))
+ (let ((data (buffer-string)))
+ (or (and (eq type 'gif)
+ (or w3m-should-unoptimize-animated-gifs
+ w3m-should-convert-interlaced-gifs)
+ w3m-gifsicle-program
+ (w3m-fix-gif url data no-cache))
+ (and (eq type 'xbm)
+ (let (width height content)
+ (with-temp-buffer
+ (insert data)
+ (goto-char (point-min))
+ (if (re-search-forward "width[ \t]+\\([0-9]+\\)")
+ (setq width (string-to-int (match-string 1))))
+ (if (re-search-forward "height[ \t]+\\([0-9]+\\)")
+ (setq height (string-to-int (match-string 1))))
+ (while (re-search-forward "0x\\(..\\)" nil t)
+ (setq content (cons (string-to-int (match-string 1) 16) content)))
+ (setq content (concat (nreverse content))))
+ (make-glyph (vector 'xbm :data (list width height content)))))
+ (make-glyph (vector type :data data)))))))))
(defun w3m-insert-image (beg end image)
"Display image on the current buffer.