(integer :tag "days")))
(list :inline t :format "%v"
(const :format "" prefetch-articles)
- (boolean :tag "Prefetch articles"
- :on "on"
- :off "off"))
+ (choice :tag "Prefetch articles"
+ :value off
+ (const on)
+ (const off)))
+ (list :inline t :format "%v"
+ (const :format "" encapsulate-images)
+ (choice :tag "Encapsulate article"
+ :value on
+ (const on)
+ (const off)))
(list :inline t :format "%v"
(const :format "" expiry-wait)
(choice :tag "Expire wait"
;; The group parameter `nnshimbun-group-parameters' will have a
;; property list like the following:
;;
-;; '(index-range all prefetch-articles t expiry-wait 6)
+;; '(index-range all prefetch-articles off encapsulate-images on
+;; expiry-wait 6)
(gnus-define-group-parameter
nnshimbun-group-parameters
a group name regexp and a plist which consists of a keyword and a value
pairs like the following:
-'(\"^nnshimbun\\\\+asahi:\" index-range all prefetch-articles t expiry-wait 6)
+'(\"^nnshimbun\\\\+asahi:\" index-range all prefetch-articles off
+ encapsulate-images on expiry-wait 6)
`index-range' specifies a range of header indices as described below:
all: Retrieve all header indices.
`prefetch-articles' specifies whether to pre-fetch the unread articles
when scanning the group.
+`encapsulate-images' specifies whether inline images in the shimbun
+article are encapsulated.
+
`expiry-wait' is similar to the generic group parameter `expiry-wait',
but it has a preference."
:variable-group nnshimbun
`Prefetch articles' specifies whether to pre-fetch the unread articles
when scanning the group.
+`Encapsulate article' specifies whether inline images in the shimbun
+article are encapsulated.
+
`Expire wait' is similar to the generic group parameter `expiry-wait',
but it has a preference.")
nnshimbun groups. You can specify the nnshimbun group parameter
`prefecth-articles' for each nnshimbun group.")
+(defvoo nnshimbun-encapsulate-images shimbun-encapsulate-images
+ "*If non-nil, inline images will be encapsulated in the articles.
+Note that this variable has just a default value for all the nnshimbun
+groups. You can specify the nnshimbun group parameter
+`encapsulate-images' for each nnshimbun group.")
+
(defvoo nnshimbun-index-range nil
"*Range of indices to detect new pages. Note that this variable has
just a default value for all the nnshimbun groups. You can specify
(put 'nnshimbun-backlog 'edebug-form-spec '(form body))
+;;; Group parameter
+(defmacro nnshimbun-find-parameter (group symbol &optional full-name-p)
+ "Return the value of a nnshimbun group parameter for GROUP which is
+associated with SYMBOL. If FULL-NAME-P is non-nil, it treats that
+GROUP has a full name."
+ (let ((name (if full-name-p
+ group
+ `(concat "nnshimbun+" (nnoo-current-server 'nnshimbun)
+ ":" ,group))))
+ (cond ((eq 'index-range (eval symbol))
+ `(or (plist-get (nnshimbun-find-group-parameters ,name)
+ 'index-range)
+ nnshimbun-index-range))
+ ((eq 'prefetch-articles (eval symbol))
+ `(let ((v (or (plist-get (nnshimbun-find-group-parameters ,name)
+ 'prefetch-articles)
+ nnshimbun-pre-fetch-article)))
+ (if (eq v 'off) nil v)))
+ ((eq 'encapsulate-images (eval symbol))
+ `(let ((v (or (plist-get (nnshimbun-find-group-parameters ,name)
+ 'encapsulate-images)
+ nnshimbun-encapsulate-images)))
+ (if (eq v 'off) nil v)))
+ ((eq 'expiry-wait (eval symbol))
+ (if full-name-p
+ `(or (plist-get (nnshimbun-find-group-parameters ,group)
+ 'expiry-wait)
+ (gnus-group-find-parameter ,group 'expiry-wait))
+ `(let ((name ,name))
+ (or (plist-get (nnshimbun-find-group-parameters name)
+ 'expiry-wait)
+ (gnus-group-find-parameter name 'expiry-wait)))))
+ (t
+ `(plist-get (nnshimbun-find-group-parameters ,name) ,symbol)))))
+
+
;;; Interface Functions
(nnoo-define-basics nnshimbun)
(when header
(with-current-buffer (or to-buffer nntp-server-buffer)
(delete-region (point-min) (point-max))
- (shimbun-article nnshimbun-shimbun header)
+ (let ((shimbun-encapsulate-images
+ (nnshimbun-find-parameter group 'encapsulate-images)))
+ (shimbun-article nnshimbun-shimbun header))
(when (> (buffer-size) 0)
;; Kludge! replace a date string in `gnus-newsgroup-data'
;; based on the newly retrieved article.
(insert " "))
(forward-line 1)))
-(defmacro nnshimbun-find-parameter (group symbol &optional full-name-p)
- "Return the value of a nnshimbun group parameter for GROUP which is
-associated with SYMBOL. If FULL-NAME-P is non-nil, it treats that
-GROUP has a full name."
- (let ((name (if full-name-p
- group
- `(concat "nnshimbun+" (nnoo-current-server 'nnshimbun)
- ":" ,group))))
- (cond ((eq 'index-range (eval symbol))
- `(or (plist-get (nnshimbun-find-group-parameters ,name)
- 'index-range)
- nnshimbun-index-range))
- ((eq 'prefetch-articles (eval symbol))
- `(or (plist-get (nnshimbun-find-group-parameters ,name)
- 'prefetch-articles)
- nnshimbun-pre-fetch-article))
- ((eq 'expiry-wait (eval symbol))
- (if full-name-p
- `(or (plist-get (nnshimbun-find-group-parameters ,group)
- 'expiry-wait)
- (gnus-group-find-parameter ,group 'expiry-wait))
- `(let ((name ,name))
- (or (plist-get (nnshimbun-find-group-parameters name)
- 'expiry-wait)
- (gnus-group-find-parameter name 'expiry-wait)))))
- (t
- `(plist-get (nnshimbun-find-group-parameters ,name) ,symbol)))))
-
(defun nnshimbun-generate-nov-database (group)
(nnshimbun-possibly-change-group group)
(with-current-buffer (nnshimbun-open-nov group)
\e$B?t\e(B @code{nnshimbun-pre-fetch-article} \e$B$,\e(B @code{nil} \e$B0J30$NCM$K%;%C%H$5$l\e(B
\e$B$F$$$?$J$i$P!"%0%k!<%W%Q%i%a!<%?\e(B @code{prefetch-articles} \e$B$,@_Dj$5$l$F$$\e(B
\e$B$J$$$+!"$=$NCM$,\e(B @code{nil} \e$B$K$J$C$F$$$k%0%k!<%W$G$b!"A0$b$C$F5-;v$N%@%&\e(B
-\e$B%s%m!<%I$r9T$J$$$^$9!#\e(B
+\e$B%s%m!<%I$r9T$J$$$^$9!#JQ?t\e(B @code{nnshimbun-pre-fetch-article} \e$B$N%G%#%U%)\e(B
+\e$B%k%HCM$O\e(B @code{nil} \e$B$G$9!#\e(B
+
+@item encapsulate-images
+@vindex nnshimbun-encapsulate-images
+\e$B$3$N%0%k!<%W%Q%i%a!<%?$,\e(B @code{nil} \e$B0J30$NCM$K%;%C%H$5$l$F$$$k%0%k!<%W$G\e(B
+\e$B$O!"\e(B@code{nnshimbun} \e$B$O85$K5-;v$KKd$a9~$^$l$F$$$k2hA|%G!<%?\e(B
+\e$B$r\e(B @samp{multipart/related} \e$B$N7A<0$G5-;v$K$O$a9~$_$^$9!#$b$7!"JQ\e(B
+\e$B?t\e(B @code{nnshimbun-encapsulate-images} \e$B$,\e(B @code{nil} \e$B0J30$NCM$K%;%C%H$5\e(B
+\e$B$l$F$$$?$J$i$P!"%0%k!<%W%Q%i%a!<%?\e(B @code{encapsulate-images} \e$B$,@_Dj$5$l\e(B
+\e$B$F$$$J$$$+!"$=$NCM$,\e(B @code{nil} \e$B$K$J$C$F$$$k%0%k!<%W$G$b!"2hA|%G!<%?$r\e(B
+@samp{multipart/related} \e$B$N7A<0$G5-;v$K$O$a9~$_$^$9!#JQ\e(B
+\e$B?t\e(B @code{nnshimbun-encapsulate-images} \e$B$N%G%#%U%)%k%HCM\e(B
+\e$B$O!"\e(B@code{shimbun} \e$B%i%$%V%i%j$NJQ?t\e(B @code{shimbun-encapsulate-images} \e$B$N\e(B
+\e$BCM$G$9\e(B (\e$B$?$V$s$=$N%G%#%U%)%k%HCM$O\e(B @code{t} \e$B$G$9\e(B)\e$B!#\e(B
@item index-range
@vindex nnshimbun-index-range
\e$B%0%k!<%W%Q%i%a!<%?\e(B @code{index-range} \e$B$,@_Dj$5$l$F$$$J$$$+!"CM\e(B
\e$B$,\e(B @code{nil} \e$B$K$J$C$F$$$k%0%k!<%W$G$O!"JQ\e(B
\e$B?t\e(B @code{nnshimbun-index-range} \e$B$NCM$,%G%#%U%)%k%H$H$7$F;H$o$l$^$9!#\e(B
+\e$B$J$*!"\e(B@code{nnshimbun-index-range} \e$B$N%G%#%U%)%k%HCM$O\e(B @code{nil} \e$B$G$9!#\e(B
@item nnshimbun-group-parameters-alist
@vindex nnshimbun-group-parameters-alist
@code{nnshimbun-group-parameters-alist} \e$B$O%+%9%?%^%$%:2DG=$J%f!<%6%*%W%7%g\e(B
\e$B%s$G!"3FMWAG$K%0%k!<%WL>$N@55,I=8=$H\e(B @code{nnshimbun} \e$B@lMQ$N%0%k!<%W%Q%i\e(B
\e$B%a!<%?$HF1$8%W%m%Q%F%#%j%9%H$r;}$D$3$H$,$G$-$kO"A[%j%9%H$G$9!#O"A[%j%9%H\e(B
-\e$B$N3FMWAG$O<!$N$h$&$JCM$r;}$A$^$9!#\e(B
+\e$B$N3FMWAG$O<!$N$h$&$JCM$r;}$A$^$9!#=i4|CM$O\e(B @code{nil} \e$B$G$9!#\e(B
@lisp
'("^nnshimbun\\+asahi:"