2 ;;; tm-sgnus.el --- tm-gnus module for September GNUS
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
10 ;;; This file is part of tm (Tools for MIME).
22 (defconst tm-gnus/RCS-ID
23 "$Id: tm-sgnus.el,v 7.0 1995/10/03 05:09:53 morioka Exp $")
25 (defconst tm-gnus/version
26 (concat (get-version-string tm-gnus/RCS-ID) " for September"))
32 (autoload 'mime/viewer-mode "tm-view" "View MIME message." t)
33 (autoload 'mime/decode-message-header
34 "tm-ew-d" "Decode MIME encoded-words in message header." t)
35 (autoload 'mime/decode-encoded-words-string
36 "tm-ew-d" "Decode MIME encoded-words in string." t)
42 (defvar tm-gnus/decode-all t
44 tm-gnus/automatic-MIME-preview-support is non-nil,
45 article is automatic MIME decoded.")
48 ;;; @ command functions
51 (defun tm-gnus/view-message (arg)
52 "MIME decode and play this message."
54 (let ((gnus-break-pages nil))
55 (gnus-summary-select-article t t)
57 (pop-to-buffer gnus-original-article-buffer t)
58 (let (buffer-read-only)
59 (if (text-property-any (point-min) (point-max) 'invisible t)
60 (remove-text-properties (point-min) (point-max)
61 gnus-hidden-properties)
66 (defun tm-gnus/summary-scroll-down ()
67 "Scroll down one line current article."
69 (gnus-summary-scroll-up -1)
72 (define-key gnus-summary-mode-map "v" (function tm-gnus/view-message))
73 (define-key gnus-summary-mode-map
74 "\e\r" (function tm-gnus/summary-scroll-down))
80 (defun mime-viewer/quitting-method-for-sgnus ()
81 (mime-viewer/kill-buffer)
82 (delete-other-windows)
83 (gnus-article-show-summary)
84 (gnus-summary-display-article (gnus-summary-article-number))
91 (set-alist 'mime-viewer/quitting-method-alist
92 'gnus-original-article-mode
93 (function mime-viewer/quitting-method-for-sgnus))
100 (defun tm-gnus/decode-summary-from-and-subjects ()
101 (mapcar (lambda (header)
102 (let ((from (mail-header-from header))
103 (subj (mail-header-subject header))
105 (mail-header-set-from
108 (mime/decode-encoded-words-string from)
110 (mail-header-set-subject
113 (mime/decode-encoded-words-string subj)
116 gnus-newsgroup-headers)
119 (add-hook 'gnus-select-group-hook
120 (function tm-gnus/decode-summary-from-and-subjects))
126 (defun tm-gnus/preview-article ()
127 (let (mime-viewer/ignored-field-list)
128 (make-local-variable 'tm:mother-button-dispatcher)
129 (setq tm:mother-button-dispatcher
130 (function gnus-article-push-button))
131 (mime/viewer-mode nil nil nil gnus-original-article-buffer
135 (defun tm-gnus/set-mime-method (mode)
136 (setq gnus-show-mime-method
138 (function tm-gnus/preview-article)
139 (function mime/decode-message-header)
142 (tm-gnus/set-mime-method tm-gnus/decode-all)
144 (setq gnus-show-mime t)
153 (set-alist 'mime/message-sender-alist
155 (function gnus-inews-news))