annotate lisp/tm/tm-latex.el @ 29:7976500f47f9

Added tag r19-15b97 for changeset 1917ad0d78d7
author cvs
date Mon, 13 Aug 2007 08:51:58 +0200
parents 49a24b4fd526
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 ;;; tm-latex: tm-view internal decoder for LaTeX
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
3 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 ;;; by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp> (1994/11/11)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6 ;;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 ;;;
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 8
diff changeset
8 ;;; $Id: tm-latex.el,v 1.3 1996/12/29 00:15:14 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 (require 'tm-view)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 (defun mime/decode-text/latex (beg end cal)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 (let* ((cur-buf (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 new-buf
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 (name (or (cdr (assoc "name" cal))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 (cdr (assoc "x-name" cal))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 (concat (make-temp-name "tm") ".tex"))))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 (switch-to-buffer mime::article/preview-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 (funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21 (if (or (<= (buffer-size) 0)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 (y-or-n-p "Replace the existing buffer?"))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 (erase-buffer)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 (setq new-buf (current-buffer))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 (set-buffer cur-buf)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 (goto-char beg)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 (re-search-forward "^$")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 (append-to-buffer new-buf (+ (match-end 0) 1) end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 (set-atype 'mime/content-decoding-condition
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 '((type . "text/x-latex")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 (method . mime/decode-text/latex)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (set-atype 'mime/content-decoding-condition
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 '((type . "application/x-latex")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 (method . mime/decode-text/latex)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 ;(set-atype 'mime/content-decoding-condition
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 ; '((type . "application/octet-stream")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 ; ("type" . "latex")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 ; (method . mime/decode-text/latex)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 ; ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 (provide 'tm-latex)