--- /dev/null
+* tm
+
+tm/tm-def.el
+----------------------------
+revision 6.6
+date: 1995/09/24 22:24:17; author: morioka; state: Exp; lines: +9 -4
+Function `tm:browse-url' was defined.
+----------------------------
+revision 6.5
+date: 1995/09/24 20:19:02; author: morioka; state: Exp; lines: +14 -4
+Function `tm:button-dispatcher' was modified to call variable
+`tm:mother-button-dispatcher' when tm-callback is not found.
+----------------------------
+revision 6.4
+date: 1995/09/22 00:08:37; author: morioka; state: Exp; lines: +14 -1
+Variable `tm:URL-regexp' and variable `browse-url-browser-function'
+are defined.
+----------------------------
+
+tm/tm-view.el
+----------------------------
+revision 6.92
+date: 1995/09/24 22:25:24; author: morioka; state: Exp; lines: +2 -2
+Function `tm:browse-url' was called instead of variable
+`browse-url-browser-function'.
+----------------------------
+revision 6.91
+date: 1995/09/24 20:16:11; author: morioka; state: Exp; lines: +16 -10
+Some functions were added optional arguments to specify article-buffer
+and preview-buffer. It is to support preview buffer support feature of
+September Gnus.
+----------------------------
+revision 6.90
+date: 1995/09/22 00:02:55; author: morioka; state: Exp; lines: +41 -25
+(1) Does not decode X-Face automatically. New command
+ `mime-viewer/display-x-face' to decode X-Face was bound to `f' key
+ of mime/viewer-mode.
+(2) If variable `browse-url-browser-function' is set, button to call
+ it is set for URL regions of text/plain contents.
+----------------------------
+revision 6.89
+date: 1995/09/21 23:20:55; author: morioka; state: Exp; lines: +4 -6
+Format of variable `mime-viewer/ignored-field-regexp' was changed. Its
+head is `^', bottom is `:'.
+----------------------------
+
+
+* tm/gnus
+
+ Attached version 6.23.
+
+tm/gnus/tm-gnus.el
+----------------------------
+revision 6.4
+date: 1995/09/24 20:22:40; author: morioka; state: Exp; lines: +5 -2
+(require 'tm-sgnus) when September Gnus.
+----------------------------
+
+tm/gnus/tm-sgnus.el
+----------------------------
+revision 6.23
+date: 1995/09/24 20:20:32; author: morioka; state: Exp;
+It was created for September Gnus.
+Notice that it needs September Gnus v0.02 or later.
+----------------------------
--- /dev/null
+* tm
+
+tm/tm-def.el
+----------------------------
+revision 6.6
+date: 1995/09/24 22:24:17; author: morioka; state: Exp; lines: +9 -4
+\e$B4X?t\e(B tm:browse-url \e$B$rDj5A$7$?!#\e(B
+----------------------------
+revision 6.5
+date: 1995/09/24 20:19:02; author: morioka; state: Exp; lines: +14 -4
+\e$BJQ?t\e(B tm:mother-button-dispatcher \e$B$rDI2C$7!"\e(Btm-callback \e$B$,8+$D$+$i$J$$\e(B
+\e$B;~$3$l$r8F$V$h$&$K!"4X?t\e(B tm:button-dispatcher \e$B$r=$@5$7$?!#\e(B
+----------------------------
+revision 6.4
+date: 1995/09/22 00:08:37; author: morioka; state: Exp; lines: +14 -1
+\e$BJQ?t\e(B tm:URL-regexp \e$B$HJQ?t\e(B browse-url-browser-function \e$B$rDj5A$7$?!#\e(B
+----------------------------
+
+tm/tm-view.el
+----------------------------
+revision 6.92
+date: 1995/09/24 22:25:24; author: morioka; state: Exp; lines: +2 -2
+\e$BJQ?t\e(B browse-url-browser-function \e$B$rD>@\8F$VBe$o$j$K!"4X?t\e(B
+tm:browse-url \e$B$r8F$V$h$&$K$7$?!#\e(B
+----------------------------
+revision 6.91
+date: 1995/09/24 20:16:11; author: morioka; state: Exp; lines: +16 -10
+September Gnus \e$B$KBP1~$9$k$?$a!"\e(Boptional \e$BJQ?t$H$7$F\e(B article-buffer \e$B$H\e(B
+preview-buffer \e$B$r;XDj$G$-$k$h$&$K$7$?!#\e(B
+----------------------------
+revision 6.90
+date: 1995/09/22 00:02:55; author: morioka; state: Exp; lines: +41 -25
+(1) \e$B<+F0E*$K\e(B X-Face \e$B$r\e(B decode \e$B$9$k$N$O$d$a!"\e(Bmime/viewer-mode \e$B$N\e(B `f'
+ key \e$B$K\e(B decode \e$B$9$k$?$a$N\e(B command `mime-viewer/display-x-face' \e$B$r\e(B
+ bind \e$B$7$?!#\e(B
+(2) \e$B$b$7!"JQ?t\e(B browse-url-browser-function \e$B$,@_Dj$5$l$F$$$l$P!"\e(B
+ text/plain content \e$B$N\e(B URL \e$B$KBP$7$F!"$3$l$r8F$V\e(B button \e$B$r@_Dj$9$k$h\e(B
+ \e$B$&$K$7$?!#\e(B
+----------------------------
+revision 6.89
+date: 1995/09/21 23:20:55; author: morioka; state: Exp; lines: +4 -6
+\e$BJQ?t\e(B mime-viewer/ignored-field-regexp \e$B$N@hF,$K\e(B `^', \e$BKvHx$K\e(B `:' \e$B$rIU$1\e(B
+\e$B$k$h$&$K$7$?!#\e(B
+----------------------------
+
+
+* tm/gnus
+
+ Version 6.23 \e$B$rE:IU$7$?!#\e(B
+
+tm/gnus/tm-gnus.el
+----------------------------
+revision 6.4
+date: 1995/09/24 20:22:40; author: morioka; state: Exp; lines: +5 -2
+September Gnus \e$B$N;~\e(B tm-sgnus \e$B$r\e(B require \e$B$9$k$h$&$K$7$?!#\e(B
+----------------------------
+
+tm/gnus/tm-sgnus.el
+----------------------------
+revision 6.23
+date: 1995/09/24 20:20:32; author: morioka; state: Exp;
+September Gnus \e$BMQ$N\e(B module \e$B$H$7$F?7@_$7$?!#\e(B
+September Gnus v0.02 \e$B0J9_$,I,MW$J$N$GCm0U$9$k$3$H!#\e(B
+----------------------------
FILES = $(TM_FILES) $(TM_MUA_FILES) $(MEL_FILES) $(TL_FILES)
-TARFILE = tm6.88.tar
+TARFILE = tm6.92.tar
nemacs:
#
-# $Id: Makefile,v 6.3 1995/06/17 18:54:48 morioka Exp morioka $
+# $Id: Makefile,v 6.4 1995/09/24 20:23:39 morioka Exp morioka $
#
# Please specify emacs executables:
FILES = tm/gnus/*.el tm/doc/tm-gnus*.texi
-TARFILE = tm-gnus6.22.1.tar
+TARFILE = tm-gnus6.23.tar
gnus3:
gnus5:
$(EMACS) -batch -l g5-path -l mk-tgnus -f compile-tm-gnus
+sgnus:
+ $(EMACS) -batch -l s-path -l mk-tgnus -f compile-tm-gnus
+
install-18:
$(EMACS) -batch -l g3-path -l mk-tgnus -f install-tm-gnus $(TMDIR18)
)
((string-match "Gnus v5" gnus-version)
(byte-compile-file "tm-gnus5.el")
+ )
+ ((string-match "September Gnus" gnus-version)
+ (byte-compile-file "tm-sgnus.el")
))
(byte-compile-file "tm-gnus.el")
)
)
(progn
(install-el-files path
- "tm-gnus.el" "tm-gnus5.el"
- "tm-dgnus.el"
+ "tm-gnus.el" "tm-sgnus.el"
+ "tm-gnus5.el" "tm-dgnus.el"
"tm-ognus.el" "tm-gnus4.el")
(install-elc-files path
- "tm-gnus.elc" "tm-gnus5.elc"
- "tm-dgnus.elc"
+ "tm-gnus.elc" "tm-sgnus.elc"
+ "tm-gnus5.elc" "tm-dgnus.elc"
"tm-gnus4.elc")
))))
--- /dev/null
+;;; -*-Emacs-Lisp-*-
+
+(setq load-path
+ (append
+ (mapcar (function
+ (lambda (path)
+ (expand-file-name path (getenv "PWD"))
+ ))
+ '("." ".." "../../tl/" "../../mel/"))
+ ;;
+ ;; (ding) GNUS path
+ ;;
+ ;; please edit this
+ ;;
+ '("/usr/local/lib/emacs/site-lisp/sgnus/lisp")
+ ;;
+ load-path))
;;;
;;; Author: Morioka Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: tm-gnus.el,v 6.3 1995/09/21 02:59:55 morioka Exp $
+;;; $Id: tm-gnus.el,v 6.4 1995/09/24 20:22:40 morioka Exp $
;;; Keywords: news, MIME, multimedia, encoded-word, multilingual
;;;
;;; This file is part of tm (Tools for MIME).
((string-match "(ding)" gnus-version)
(require 'tm-dgnus)
)
- ((string-match "^Gnus v5\\|^September Gnus" gnus-version)
+ ((string-match "^Gnus v5" gnus-version)
(require 'tm-gnus5)
+ )
+ ((string-match "^September Gnus" gnus-version)
+ (require 'tm-sgnus)
))
--- /dev/null
+;;;
+;;; tm-sgnus.el --- tm-gnus module for September GNUS
+;;;
+
+(require 'tl-str)
+(require 'tl-list)
+(require 'tl-misc)
+(require 'gnus)
+
+
+;;; @ version
+;;;
+
+(defconst tm-gnus/RCS-ID
+ "$Id: tm-sgnus.el,v 6.23 1995/09/24 20:20:32 morioka Exp $")
+
+(defconst tm-gnus/version
+ (concat (get-version-string tm-gnus/RCS-ID) " for September"))
+
+
+;;; @ autoload
+;;;
+
+(autoload 'mime/viewer-mode "tm-view" "View MIME message." t)
+(autoload 'mime/decode-message-header
+ "tiny-mime" "Decode MIME encoded-word." t)
+(autoload 'mime/decode-string "tiny-mime" "Decode MIME encoded-word." t)
+
+
+;;; @ variables
+;;;
+
+(defvar tm-gnus/decode-all t
+ "If it is non-nil and
+tm-gnus/automatic-MIME-preview-support is non-nil,
+article is automatic MIME decoded.")
+
+
+;;; @ command functions
+;;;
+
+(defun tm-gnus/view-message (arg)
+ "MIME decode and play this message."
+ (interactive "P")
+ (let ((gnus-break-pages nil))
+ (gnus-summary-select-article t t)
+ )
+ (pop-to-buffer gnus-original-article-buffer t)
+ (let (buffer-read-only)
+ (if (text-property-any (point-min) (point-max) 'invisible t)
+ (remove-text-properties (point-min) (point-max)
+ gnus-hidden-properties)
+ ))
+ (mime/viewer-mode)
+ )
+
+(defun tm-gnus/summary-scroll-down ()
+ "Scroll down one line current article."
+ (interactive)
+ (gnus-summary-scroll-up -1)
+ )
+
+(define-key gnus-summary-mode-map "v" (function tm-gnus/view-message))
+(define-key gnus-summary-mode-map
+ "\e\r" (function tm-gnus/summary-scroll-down))
+
+
+;;; @ for tm-view
+;;;
+
+(defun mime-viewer/quitting-method-for-sgnus ()
+ (mime-viewer/kill-buffer)
+ (delete-other-windows)
+ (gnus-article-show-summary)
+ (gnus-summary-display-article (gnus-summary-article-number))
+ )
+
+(call-after-loaded
+ 'tm-view
+ (function
+ (lambda ()
+ (set-alist 'mime-viewer/quitting-method-alist
+ 'fundamental-mode
+ (function mime-viewer/quitting-method-for-sgnus))
+ (set-alist 'tm:callback-property-alist
+ 'fundamental-mode 'gnus-callback)
+ (set-alist 'tm:data-property-alist
+ 'fundamental-mode 'gnus-data)
+ )))
+
+
+;;; @ summary filter
+;;;
+
+(defun tm-gnus/decode-summary-from-and-subjects ()
+ (mapcar (function
+ (lambda (header)
+ (mail-header-set-from
+ header
+ (mime/decode-string (or (mail-header-from header) ""))
+ )
+ (mail-header-set-subject
+ header
+ (mime/decode-string (or (mail-header-subject header) ""))
+ )
+ ))
+ gnus-newsgroup-headers)
+ )
+
+(add-hook 'gnus-select-group-hook
+ (function tm-gnus/decode-summary-from-and-subjects))
+
+
+;;; @ article filter
+;;;
+
+(defun tm-gnus/preview-article ()
+ (let (mime-viewer/ignored-field-list)
+ (make-local-variable 'tm:mother-button-dispatcher)
+ (setq tm:mother-button-dispatcher
+ (function gnus-article-push-button))
+ (mime/viewer-mode nil nil nil gnus-original-article-buffer
+ gnus-article-buffer)
+ ))
+
+(defun tm-gnus/set-mime-method (mode)
+ (setq gnus-show-mime-method
+ (if mode
+ (function tm-gnus/preview-article)
+ (function mime/decode-message-header)
+ )))
+
+(tm-gnus/set-mime-method tm-gnus/decode-all)
+
+(setq gnus-show-mime t)
+
+
+;;; @ for tm-comp
+;;;
+
+(call-after-loaded
+ 'tm-comp
+ (lambda ()
+ (set-alist 'mime/message-sender-alist
+ 'news-reply-mode
+ (function gnus-inews-news))
+ ))
+
+
+;;; @ end
+;;;
+
+(provide 'tm-sgnus)
case "$4" in
"play")
- filename = /dev/audio
+ filename=/dev/audio
;;
"extract")
if [ "$5" = "" ]; then
;;;
(defconst tm-mh-e/RCS-ID
- "$Id: tm-mh-e.el,v 6.32 1995/09/21 00:20:10 morioka Exp $")
+ "$Id: tm-mh-e.el,v 6.34 1995/09/22 00:07:42 morioka Exp $")
(defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID))
(symbol-function 'mime/code-convert-region-to-emacs))
(defun tm-mh-e/content-header-filter ()
- (mime-viewer/x-face-function)
(goto-char (point-min))
- (while (and (re-search-forward
- (concat "^" mime-viewer/ignored-field-regexp ":")
- nil t)
+ (while (and (re-search-forward mime-viewer/ignored-field-regexp nil t)
(progn
(delete-region
(match-beginning 0)
;;; -*-Emacs-Lisp-*-
;;;
-;;; $Id: mk-tm,v 2.0 1995/09/04 00:50:39 morioka Exp morioka $
+;;; $Id: mk-tm,v 3.0 1995/09/24 20:41:39 morioka Exp morioka $
;;;
(setq load-path (append
))
'("signature"
"tiny-mime" "tm-def" "tm-view"
- "tm-latex" "tm-w3"
+ "tm-latex" "tm-w3" "tm-tar"
"tm-rmail" "tm-comp"
"tm-setup" "mime-setup"
))
;;;
;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Version:
-;;; $Id: tm-def.el,v 6.3 1995/09/21 00:12:52 morioka Exp $
+;;; $Id: tm-def.el,v 6.6 1995/09/24 22:24:17 morioka Exp $
;;; Keywords: mail, news, MIME, multimedia, definition
;;;
;;; This file is part of tm (Tools for MIME).
(t (require 'tm-orig))
)
+
+;;; @ button
+;;;
+
(defun tm:set-face-region (b e face)
(let ((overlay (tl:make-overlay b e)))
(tl:overlay-put overlay 'face face)
))
)
+(defvar tm:mother-button-dispatcher nil)
+
(defun tm:button-dispatcher (event)
"Select the button under point."
(interactive "e")
(mouse-set-point event)
- (let ((func (get-text-property (point) 'tm-callback)))
+ (let ((func (get-text-property (point) 'tm-callback))
+ (data (get-text-property (point) 'tm-data))
+ )
(if func
- (call-interactively func)
- )))
+ (apply func data)
+ (if (fboundp tm:mother-button-dispatcher)
+ (funcall tm:mother-button-dispatcher event)
+ )
+ )))
+
+
+;;; @ for URL
+;;;
+
+(defvar tm:URL-regexp
+ "\\(http\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
+
+(defvar browse-url-browser-function nil)
+
+(defun tm:browse-url ()
+ (if (fboundp browse-url-browser-function)
+ (call-interactively browse-url-browser-function)
+ (if (fboundp tm:mother-button-dispatcher)
+ (funcall tm:mother-button-dispatcher event)
+ )
+ ))
;;; @ definitions about MIME
;;;
(defconst mime-viewer/RCS-ID
- "$Id: tm-view.el,v 6.88 1995/09/21 02:33:28 morioka Exp $")
+ "$Id: tm-view.el,v 6.92 1995/09/24 22:25:24 morioka Exp $")
(defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
(defconst mime/viewer-version mime-viewer/version)
;;; @@ content header filter
;;;
-;;; @@@ X-Face
-;;;
-
-;; hack from Gnus 5.0.4.
-
-(defvar mime-viewer/x-face-command
- "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | xv -quit -"
- "String to be executed to display an X-Face field.
-The command will be executed in a sub-shell asynchronously.
-The compressed face will be piped to this command.")
-
-(defun mime-viewer/x-face-function ()
- "Function to display X-Face field. You can redefine to customize."
- (goto-char (point-min))
- (if (re-search-forward "^X-Face:[ \t]*" nil t)
- (let ((beg (match-end 0))
- (end (message/field-end))
- )
- (call-process-region beg end "sh" nil 0 nil
- "-c" mime-viewer/x-face-command)
- )))
-
(defun mime-viewer/default-content-header-filter ()
- (mime-viewer/x-face-function)
(goto-char (point-min))
- (while (and (re-search-forward
- (concat "^" mime-viewer/ignored-field-regexp ":")
- nil t)
+ (while (and (re-search-forward mime-viewer/ignored-field-regexp nil t)
(progn
(delete-region
(match-beginning 0)
))
+;;; @@ X-Face
+;;;
+
+;; hack from Gnus 5.0.4.
+
+(defvar mime-viewer/x-face-command
+ "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | xv -quit -"
+ "String to be executed to display an X-Face field.
+The command will be executed in a sub-shell asynchronously.
+The compressed face will be piped to this command.")
+
+(defun mime-viewer/x-face-function ()
+ "Function to display X-Face field. You can redefine to customize."
+ (goto-char (point-min))
+ (if (re-search-forward "^X-Face:[ \t]*" nil t)
+ (let ((beg (match-end 0))
+ (end (message/field-end))
+ )
+ (call-process-region beg end "sh" nil 0 nil
+ "-c" mime-viewer/x-face-command)
+ )))
+
+
;;; @ data structures
;;;
;;; @ parser
;;;
-(defun mime-viewer/parse-message (&optional ctl encoding)
+(defun mime-viewer/parse-message (&optional ctl encoding ibuf obuf)
+ (if ibuf
+ (set-buffer ibuf)
+ (setq ibuf (current-buffer))
+ )
(make-variable-buffer-local 'mime::article/content-info)
(setq mime::article/content-info (mime-viewer/parse ctl encoding))
- (let ((ret (mime-viewer/make-preview-buffer)))
+ (let ((ret (mime-viewer/make-preview-buffer
+ ibuf mime::article/content-info obuf)))
(make-variable-buffer-local 'mime::article/preview-buffer)
(setq mime::article/preview-buffer (car ret))
ret))
(if (not (eq (char-after (1- (point))) ?\n))
(insert "\n")
)
- ;;(hide-sublevels 1)
+ (if browse-url-browser-function
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward tm:URL-regexp nil t)
+ (tm:add-button (match-beginning 0)(match-end 0)
+ (function tm:browse-url))
+ )))
(run-hooks 'mime-viewer/plain-text-preview-hook)
)
(define-key mime/viewer-mode-map
"\C-c\C-p" (function mime-viewer/print-content))
(define-key mime/viewer-mode-map
+ "f" (function mime-viewer/display-x-face))
+ (define-key mime/viewer-mode-map
"q" (function mime-viewer/quit))
(define-key mime/viewer-mode-map
"\C-c\C-x" (function mime-viewer/kill-buffer))
)
))
-(defun mime/viewer-mode (&optional mother ctl encoding)
+(defun mime/viewer-mode (&optional mother ctl encoding ibuf obuf)
"Major mode for viewing MIME message.
Here is a list of the standard keys for mime/viewer-mode.
v Decode current content as `play mode'
e Decode current content as `extract mode'
C-c C-p Decode current content as `print mode'
+f Display X-Face
q Quit
button-2 Move to point under the mouse cursor
and decode current content as `play mode'
"
(interactive)
(setq mime-viewer/ignored-field-regexp
- (concat "\\("
+ (concat "^\\("
(mapconcat (function regexp-quote)
mime-viewer/ignored-field-list "\\|")
- "\\)"))
- (let ((buf (get-buffer mime/output-buffer-name))
- (the-buf (current-buffer))
- )
+ "\\):"))
+ (if (null ibuf)
+ (setq ibuf (current-buffer))
+ )
+ (let ((buf (get-buffer mime/output-buffer-name)))
(if buf
(progn
- (switch-to-buffer buf)
+ (set-buffer buf)
(erase-buffer)
- (switch-to-buffer the-buf)
+ (set-buffer ibuf)
)))
- (let ((ret (mime-viewer/parse-message ctl encoding)))
+ (let ((ret (mime-viewer/parse-message ctl encoding ibuf obuf)))
(prog1
(switch-to-buffer (car ret))
(if mother
(mime-preview/decode-content)
))
+(defun mime-viewer/display-x-face ()
+ (interactive)
+ (save-window-excursion
+ (set-buffer mime::preview/article-buffer)
+ (mime-viewer/x-face-function)
+ ))
+
(defun mime-viewer/up-content ()
(interactive)
(let ((pc (mime::point-preview-content (point))) cinfo