[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [mew-dist 28418] mew-w3m.el
- From: Hideyuki SHIRAI (白井秀行) <shirai@xxxxxxxxxxx>
- Date: Fri, 16 May 2008 23:13:18 +0900 (JST)
- X-ml-name: emacs-w3m
- X-mail-count: 10134
- References: <20080516.135810.53530180.kazu@xxxxxxxxx>
From: Kazu Yamamoto (山本和彦) <kazu@xxxxxxxxx> さん曰く
Subject: [mew-dist 28418] mew-w3m.el
Message-ID: <20080516.135810.53530180.kazu@xxxxxxxxx>
Date: Fri, 16 May 2008 13:58:10 +0900 (JST)
> 多分、白井さんへ
多分、そうです ^^;
> mew-w3m.el ですが、以下のようなコードがいくつかあります。
>
> (put-text-property (point-min) (1+ (point-min)))
>
> (point-max) が 1 のとき、(1+ (point-min)) が 2 となって、
> エラーとなります。
>
> 以下のように変更されてはいかがでしょうか?
>
> (min (1+ (point-min)) (point-max))
指摘どうもありがとうございます。
無駄に macro を作ってこんな風↓にしておきました。
--
白井秀行 (mailto:shirai@xxxxxxxxxxx)
diff -u -r1.61 -r1.62
--- mew-w3m.el 17 Oct 2007 11:15:57 -0000 1.61
+++ mew-w3m.el 16 May 2008 13:53:02 -0000 1.62
@@ -119,6 +119,11 @@
(autoload 'mew-syntax-get-entry-by-cid "mew")
(defun mew-cache-hit (&rest args) ())))
+(defmacro mew-w3m-add-text-properties (props)
+ `(add-text-properties (point-min)
+ (min (1+ (point-min)) (point-max))
+ ,props))
+
(defun mew-w3m-minor-mode-setter ()
"Check message buffer and activate w3m-minor-mode."
(w3m-minor-mode (or (and (get-text-property (point-min) 'w3m)
@@ -147,8 +152,7 @@
mew-w3m-safe-url-regexp)))
(w3m-toggle-inline-images)
(mew-elet
- (put-text-property (point-min) (1+ (point-min))
- 'w3m-images (not image))
+ (mew-w3m-add-text-properties `(w3m-images ,(not image)))
(set-buffer-modified-p nil)))))))
;; processing Text/Html contents with w3m.
@@ -225,10 +229,7 @@
(progn (insert-buffer-substring cache begin end)
(point))
xref))))
- (put-text-property (point-min) (1+ (point-min)) 'w3m t)
- (put-text-property (point-min) (1+ (point-min))
- 'w3m-images mew-w3m-auto-insert-image)))))
-
+ (mew-w3m-add-text-properties `(w3m t w3m-images ,mew-w3m-auto-insert-image))))))
(defvar w3m-mew-support-cid (and (boundp 'mew-version-number)
(fboundp 'mew-syntax-get-entry-by-cid)))