tm 7.80.
[elisp/tm.git] / tm-misc.el
1 ;;;
2 ;;; $Id: tm-misc.el,v 5.2 1995/08/26 18:41:39 morioka Exp $
3 ;;;
4 ;;;   MIME utility for tm-*.el MIME user agent packages
5 ;;;
6 ;;; by Morioka Tomohiko, 1993/11/21
7 ;;;
8
9 (require 'emu)
10 (require 'tiny-mime)
11
12
13 ;;; @ variables
14 ;;;
15
16 (defvar mime/tmp-dir (or (getenv "TM_TMPDIR") "/tmp/"))
17
18 (defvar mime/header-decoding-mode t "*Decode MIME header if non-nil.")
19
20
21 ;;; @ functions
22 ;;;
23
24 (defun mime/decode-message-header-if-you-need ()
25   (if mime/header-decoding-mode
26       (mime/decode-message-header)
27     ))
28
29 (defun mime/add-header-decoding-mode-to-mode-line ()
30   (or (assq 'mime/header-decoding-mode minor-mode-alist)
31       (setq minor-mode-alist
32             (cons (list 'mime/header-decoding-mode " MIME")
33                   minor-mode-alist))
34       ))
35
36
37 ;;; @@ functions to check field
38 ;;;
39 (defun mime/exist-encoded-word-in-subject ()
40   (string-match
41    mime/encoded-word-regexp
42    (save-excursion
43      (save-restriction
44        (goto-char (point-min))
45        (if (re-search-forward "^Subject:.*\\(\n\\( \\|\t\\)+.*\\)*" nil t)
46            (buffer-substring (match-beginning 0) (match-end 0))
47          )
48        ))))
49
50
51 ;;; @ end
52 ;;;
53
54 (provide 'tm-misc)