2 ;;; tm-latex: tm-view internal decoder for LaTeX
4 ;;; by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp> (1994/11/11)
6 ;;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; $Id: tm-latex.el,v 3.0 1995/09/14 15:51:35 morioka Exp $
13 (defun mime/decode-text/latex (beg end cal)
14 (let* ((cur-buf (current-buffer))
16 (name (or (cdr (assoc "name" cal))
17 (cdr (assoc "x-name" cal))
18 (concat (make-temp-name "tm") ".tex"))))
19 (switch-to-buffer mime::article/preview-buffer)
20 (funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
21 (if (or (<= (buffer-size) 0)
22 (y-or-n-p "Replace the existing buffer?"))
25 (setq new-buf (current-buffer))
29 (re-search-forward "^$")
30 (append-to-buffer new-buf (+ (match-end 0) 1) end)
34 (set-atype 'mime/content-decoding-condition
35 '((type . "text/x-latex")
36 (method . mime/decode-text/latex)
39 (set-atype 'mime/content-decoding-condition
40 '((type . "application/x-latex")
41 (method . mime/decode-text/latex)
44 ;(set-atype 'mime/content-decoding-condition
45 ; '((type . "application/octet-stream")
47 ; (method . mime/decode-text/latex)