;;;
(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)
(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)
(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")
(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))
(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")
""))
))))
(if (null cl)
(setq cl mime/content-list)
)
- (let ((dest (list (car cl)))
+ (let ((dest (list cl))
(rcl (nth 2 cl))
)
(while rcl
(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
(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)
)))
(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
(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)
)
(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))
))
)
(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)