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