1 ;;; sb-text.el --- shimbun backend class for text content.
3 ;; Author: TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
4 ;; Akihiro Arisawa <ari@atesoft.advantest.co.jp>
5 ;; Yuuichi Teranishi <teranisi@gohome.org>
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, you can either send email to this
23 ;; program's maintainer or write to: The Free Software Foundation,
24 ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
28 ;; Original code was nnshimbun.el written by
29 ;; TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>.
34 (luna-define-class shimbun-text (shimbun) ())
36 (luna-define-method shimbun-make-contents ((shimbun shimbun-text)
38 (let ((case-fold-search t) (html t) (start))
39 (when (and (re-search-forward (shimbun-content-start-internal shimbun)
42 (re-search-forward (shimbun-content-end-internal shimbun)
44 (delete-region (match-beginning 0) (point-max))
45 (delete-region (point-min) start)
46 (shimbun-shallow-rendering)
48 (goto-char (point-min))
49 (shimbun-header-insert header)
50 (insert "Content-Type: " (if html "text/html" "text/plain")
51 "; charset=ISO-2022-JP\nMIME-Version: 1.0\n")
52 (when (shimbun-x-face-internal shimbun)
53 (insert (shimbun-x-face-internal shimbun))
57 (encode-coding-string (buffer-string)
58 (mime-charset-to-coding-system "ISO-2022-JP"))))
62 ;;; sb-text.el ends here