tm 5.12
[elisp/tm.git] / tm-misc.el
1 ;;;
2 ;;; $Id: tm-misc.el,v 5.0 1994/10/17 06:55:23 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/add-header-decoding-mode-to-mode-line ()
20   (or (assq 'mime/header-decoding-mode minor-mode-alist)
21       (setq minor-mode-alist
22             (cons (list 'mime/header-decoding-mode " MIME")
23                   minor-mode-alist))
24       ))
25
26
27 ;;; @ functions to check field
28 ;;;
29 (defun mime/exist-encoded-word-in-subject ()
30   (string-match
31    mime/encoded-word-regexp
32    (save-excursion
33      (save-restriction
34        (goto-char (point-min))
35        (if (re-search-forward "^Subject:.*\\(\n\\( \\|\t\\)+.*\\)*" nil t)
36            (buffer-substring (match-beginning 0) (match-end 0))
37          )
38        ))))