From 59829c47e991baab876ab9f42f13f225df1caccc Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 2 Mar 1998 13:39:33 +0000 Subject: [PATCH] tm 4.8.4. --- Makefile | 18 ++++---- methods/tm-image | 4 ++ tl-header.el | 11 ++++- tl-str.el | 4 +- tm-setup.el | 7 +++- tm-view.el | 122 ++++++++++++++++++++++++++++++++++++++---------------- 6 files changed, 117 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index 6412dad..3a091fb 100644 --- a/Makefile +++ b/Makefile @@ -4,19 +4,17 @@ CFLAGS = -O UTILS = ol2 decode-b METHODS = tm-au tm-file tm-image tm-latex tm-mpeg -OLFILES = tiny-mime-jp.ol signature-jp.ol \ - tiny-mime-eng.ol -TEXFILES= tiny-mime-jp.tex signature-jp.tex \ - tiny-mime-eng.tex -DVIFILES= tm-jp.dvi tiny-mime-jp.dvi signature-jp.dvi \ - tiny-mime-eng.dvi -PSFILES = tm-jp.ps tiny-mime-jp.ps signature-jp.ps \ - tiny-mime-eng.ps -GOMI = *.aux *.log $(TEXFILES) $(DVIFILES) *.ps $(UTILS) +OLFILES = tiny-mime-jp.ol signature-jp.ol tiny-mime-eng.ol +TEXFILES= tiny-mime-jp.tex signature-jp.tex tiny-mime-eng.tex +DVIFILES= tm-jp.dvi \ + tiny-mime-jp.dvi signature-jp.dvi tiny-mime-eng.dvi +PSFILES = tm-jp.ps \ + tiny-mime-jp.ps signature-jp.ps tiny-mime-eng.ps +GOMI = *.aux *.toc *.log $(TEXFILES) $(DVIFILES) *.ps $(UTILS) FILES = *.ol Makefile *.el *.c methods $(TEXFILES) -TARFILE = tm4.8.3.tar +TARFILE = tm4.8.4.tar .SUFFIXES: .ol .tex .dvi .ps diff --git a/methods/tm-image b/methods/tm-image index 83436e1..1a321a7 100755 --- a/methods/tm-image +++ b/methods/tm-image @@ -12,6 +12,10 @@ if( $5 == "" ) then case "image/jpeg": set filename="$TM_TMP_DIR/mime$$.jpg" breaksw + case "image/tiff": + case "image/x-tiff": + set filename="$TM_TMP_DIR/mime$$.tif" + breaksw case "image/x-xwd": set filename="$TM_TMP_DIR/mime$$.xwd" breaksw diff --git a/tl-header.el b/tl-header.el index b40bea9..5622691 100644 --- a/tl-header.el +++ b/tl-header.el @@ -1,5 +1,5 @@ ;;; -;;; $Id: tl-header.el,v 4.3 1994/08/04 00:54:26 morioka Exp $ +;;; $Id: tl-header.el,v 4.5 1994/09/02 07:10:15 morioka Exp $ ;;; (provide 'tl-header) @@ -122,3 +122,12 @@ ) (concat dest str) )) + +(defun message/strip-quoted-string (str) + (let ((max (- (length str) 1)) + ) + (if (and (eq (elt str 0) ?\") + (eq (elt str max) ?\") + ) + (substring str 1 max) + str))) diff --git a/tl-str.el b/tl-str.el index 5dce601..55ed49c 100644 --- a/tl-str.el +++ b/tl-str.el @@ -1,5 +1,5 @@ ;;; -;;; $Id: tl-str.el,v 1.3 1994/08/31 06:54:15 morioka Exp $ +;;; $Id: tl-str.el,v 1.4 1994/09/01 06:02:25 morioka Exp morioka $ ;;; (provide 'tl-str) @@ -16,7 +16,7 @@ (narrow-to-region beg end) (goto-char (point-min)) (let* ((fill-prefix - (and (re-search-forward "^[^ \t>]*[>|]+[ \t]*" nil t) + (and (re-search-forward "^[^ \t>]*[>|]+[ \t#]*" nil t) (buffer-substring (match-beginning 0) (match-end 0) ))) diff --git a/tm-setup.el b/tm-setup.el index 5ad49e8..73259da 100644 --- a/tm-setup.el +++ b/tm-setup.el @@ -1,5 +1,5 @@ ;;; -;;; $Id: tm-setup.el,v 1.3 1994/08/30 04:26:05 morioka Exp $ +;;; $Id: tm-setup.el,v 3.0 1994/09/01 05:37:13 morioka Exp $ ;;; (provide 'tm-setup) @@ -26,6 +26,11 @@ (lambda () (require 'tm-mh-e) ))) +(add-hook 'mh-letter-mode-hook + (function + (lambda () + (require 'tm-mh-e) + ))) ;;; @ for GNUS diff --git a/tm-view.el b/tm-view.el index a08a312..4343565 100644 --- a/tm-view.el +++ b/tm-view.el @@ -10,7 +10,7 @@ ;;; (defconst mime/viewer-RCS-ID - "$Id: tm-view.el,v 3.1 1994/08/31 07:16:10 morioka Exp $") + "$Id: tm-view.el,v 3.8 1994/09/02 10:32:31 morioka Exp $") (defconst mime/viewer-version (and (string-match "[0-9][0-9.]*" mime/viewer-RCS-ID) @@ -65,9 +65,6 @@ (defvar mime/default-showing-Content-Type-list '("text/plain" "text/x-latex" "message/rfc822")) -(setq mime/default-showing-Content-Type-list - '("text/plain" "text/x-latex" "message/rfc822")) - (defvar mime/go-to-top-node-method-alist '((gnus-article-mode . (lambda () (gnus-article-show-summary) @@ -95,6 +92,8 @@ (defvar mime/tmp-dir "/tmp/") +(defvar mime/hide-content-header nil) + (defvar mime/use-internal-decoder nil) (defvar mime/body-decoding-mode "play" "MIME body decoding mode") @@ -114,7 +113,9 @@ (search-forward "\n\n" nil t) (cond (boundary (let ((sep (concat "\n--" - (setq boundary (read (cdr boundary))) + (setq boundary + (message/strip-quoted-string + (cdr boundary))) "\n")) cb ce ct ret ncb) (setq beg (match-end 0)) @@ -223,10 +224,11 @@ (replace-as-filename (let (ret) (or (and (setq ret (assoc "name" ctype)) - (read (cdr ret)) + (message/strip-quoted-string (cdr ret)) ) (and (setq ret (assoc "x-name" ctype)) - (read (cdr ret))) + (message/strip-quoted-string (cdr ret)) + ) (message/get-field-body "Content-Description") "")) )))) @@ -289,7 +291,7 @@ (if (null cl) (setq cl mime/content-list) ) - (let ((dest (list (car cl))) + (let ((dest (list cl)) (rcl (nth 2 cl)) ) (while rcl @@ -437,27 +439,33 @@ (interactive "*r") (save-excursion (save-restriction - (narrow-to-region beg end) (outline-flag-region beg end ?\n) - (goto-char beg) - (let ((ctl (mime/Content-Type))) - (if ctl - (let ((ctype (downcase (car ctl))) - (encoding (mime/Content-Transfer-Encoding "7bit")) - ) - (setq ctl (cdr ctl)) - (cond ((string= ctype "message/partial") - (mime/decode-message/partial-region beg end ctl encoding) - ) - (t (mime/start-external-method-region beg end - ctype ctl encoding) - (if (not (member - ctype - mime/default-showing-Content-Type-list)) - (mime/hide-region beg end) - ) - )) - )))))) + (let ((e end)) + (if (< end (point-max)) + (setq e (+ end 1)) + ) + (narrow-to-region beg e) + (goto-char beg) + (let ((ctl (mime/Content-Type))) + (if ctl + (let ((ctype (downcase (car ctl))) + (encoding (mime/Content-Transfer-Encoding "7bit")) + ) + (setq ctl (cdr ctl)) + (cond ((string= ctype "message/partial") + (mime/decode-message/partial-region beg e + ctl encoding) + ) + (t (mime/start-external-method-region beg e + ctype ctl encoding) + (if (not (member + ctype + mime/default-showing-Content-Type-list)) + (mime/hide-region beg end) + ) + )) + )))) + ))) ;;; @ hide @@ -467,8 +475,11 @@ (save-excursion (save-restriction (goto-char beg) - (search-forward "\n\n" nil t) - (setq beg (match-end 0)) + (if (not mime/hide-content-header) + (progn + (search-forward "\n\n" nil t) + (setq beg (match-end 0)) + )) (outline-flag-region beg end ?\^M) ))) @@ -476,7 +487,7 @@ (let ((fl (mime/make-flat-content-list)) p c) (while fl - (setq p (car fl)) + (setq p (car (car fl))) (setq c (mime/get-content-region (mime/get-point-content-number p))) (if (null (nth 2 c)) (save-excursion @@ -534,6 +545,8 @@ (define-key keymap "u" 'mime/up-content) (define-key keymap "p" 'mime/previous-content) (define-key keymap "n" 'mime/next-content) + (define-key keymap " " 'mime/scroll-up-content) + (define-key keymap "\M- " 'mime/scroll-down-content) (define-key keymap "v" 'mime/play-content) (define-key keymap "e" 'mime/extract-content) (define-key keymap "\C-c\C-p" 'mime/print-content) @@ -592,8 +605,8 @@ ) (catch 'tag (while (>= i 0) - (if (> p (nth i fcl)) - (throw 'tag (goto-char (nth i fcl))) + (if (> p (car (nth i fcl))) + (throw 'tag (goto-char (car (nth i fcl)))) ) (setq i (- i 1)) )) @@ -606,13 +619,52 @@ ) (catch 'tag (while fcl - (if (< p (car fcl)) - (throw 'tag (goto-char (car fcl))) + (if (< p (car (car fcl))) + (throw 'tag (goto-char (car (car fcl)))) ) (setq fcl (cdr fcl)) )) )) +(defun mime/scroll-up-content () + (interactive) + (let ((fcl (mime/make-flat-content-list)) + (p (point)) + (h (- (window-height) 1)) + np) + (setq np (or (catch 'tag + (while fcl + (if (< p (car (car fcl))) + (throw 'tag (car (car fcl))) + ) + (setq fcl (cdr fcl)) + )) + (point-max))) + (forward-line h) + (if (> (point) np) + (goto-char np) + ))) + +(defun mime/scroll-down-content () + (interactive) + (let ((fcl (mime/make-flat-content-list)) + (p (point)) + (h (- (window-height) 1)) + pp) + (setq pp (or (let ((i (- (length fcl) 1))) + (catch 'tag + (while (> i 0) + (if (> p (nth 1 (nth i fcl))) + (throw 'tag (nth 1 (nth i fcl))) + ) + (setq i (- i 1)) + ))) + (point-min))) + (forward-line (- h)) + (if (< (point) pp) + (goto-char pp) + ))) + (defun mime/exit-view-mode () (interactive) (if (and (boundp 'mime/view-mode-old-local-map) -- 1.7.10.4