/usr/share/emacs/site-lisp/w3m/shimbun/sb-mailarc.el is in w3m-el-snapshot 1.4.527+0.20140108-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | ;;; sb-mailarc.el --- shimbun backend class for mailarc
;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
;; Author: ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
;; Keywords: news
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;; Code:
(require 'shimbun)
(luna-define-class shimbun-mailarc (shimbun))
(luna-define-method shimbun-get-headers ((shimbun shimbun-mailarc)
&optional range)
(let (headers)
(catch 'stop
(goto-char (point-min))
(while (re-search-forward
"<li>\\([0-9]+\\) <strong><a href=['\"]\\([^'\"]+\\)['\"]>\\([^<]*\\)</a>\n</strong>\n<em>\\([^<]*\\)</em>\n</li>\n"
nil t)
(let ((id (format "<%s%%%s>" (match-string 1)
(shimbun-current-group-internal shimbun)))
(url (match-string 2))
(subject (match-string 3))
(from (match-string 4)))
(when (shimbun-search-id shimbun id)
(throw 'stop headers))
(push (shimbun-make-header 0
(shimbun-mime-encode-string subject)
(shimbun-mime-encode-string from)
"" id "" 0 0 url)
headers))))
headers))
(luna-define-method shimbun-make-contents ((shimbun shimbun-mailarc) header)
(let (body-end header-start body-start)
(goto-char (point-min))
(when (and (setq header-start (search-forward "<hr>\n" nil t))
(setq body-start (search-forward "<hr>\n" nil t))
(search-forward "<hr>\n" nil t))
(set-marker (setq body-end (make-marker)) (match-beginning 0))
;; parse headers
(save-restriction
(narrow-to-region header-start body-start)
(goto-char (point-min))
(while (re-search-forward
"<li><strong>\\([^:]+\\):</strong>\n\\([^<]*\\)</li>\n"
body-start t)
(let ((field (match-string 1))
(value (shimbun-mime-encode-string (match-string 2))))
(cond ((string= field "Subject")
(shimbun-header-set-subject header value))
((string= field "Date")
(shimbun-header-set-date header value))
((string= field "From")
(shimbun-header-set-from header value))))))
(delete-region (point-min) body-start)
(delete-region (marker-position body-end) (point-max))
(set-marker body-end nil)
(goto-char (point-min))
(insert "<html>\n<head>\n<base href=\""
(shimbun-header-xref header) "\">\n</head>\n</body>\n")
(goto-char (point-max))
(insert "\n</body>\n</html>"))
(shimbun-make-mime-article shimbun header)
(buffer-string)))
(provide 'sb-mailarc)
;;; sb-mailarc.el ends here
|