(mime-spadework-module-version-string): Update.
[elisp/flim.git] / mime-def.el
1 ;;; mime-def.el --- definition module about MIME
2
3 ;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: definition, MIME, multimedia, mail, news
7
8 ;; This file is part of FLIM (Faithful Library about Internet Message).
9
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
14
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Code:
26
27 (defconst mime-spadework-module-version-string
28   "FLIM 1.0.2 - \"T\e-Dòji\" ")\e-A
29
30 (require 'custom)
31
32 (defgroup mime nil
33   "Emacs MIME Interfaces"
34   :group 'news
35   :group 'mail)
36
37 (custom-handle-keyword 'default-mime-charset :group 'mime
38                        'custom-variable)
39
40 (unless (fboundp 'butlast)
41   (defun butlast (x &optional n)
42     "Returns a copy of LIST with the last N elements removed."
43     (if (and n (<= n 0)) x
44       (nbutlast (copy-sequence x) n)))
45   
46   (defun nbutlast (x &optional n)
47     "Modifies LIST to remove the last N elements."
48     (let ((m (length x)))
49       (or n (setq n 1))
50       (and (< n m)
51            (progn
52              (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil))
53              x))))
54   )
55
56 (defsubst eliminate-top-spaces (string)
57   "Eliminate top sequence of space or tab in STRING."
58   (if (string-match "^[ \t]+" string)
59       (substring string (match-end 0))
60     string))
61
62
63 ;;; @ definitions about MIME
64 ;;;
65
66 (defconst mime-tspecials "][()<>@,\;:\\\"/?=")
67 (defconst mime-token-regexp (concat "[^" mime-tspecials "\000-\040]+"))
68 (defconst mime-charset-regexp mime-token-regexp)
69
70 (defconst mime-media-type/subtype-regexp
71   (concat mime-token-regexp "/" mime-token-regexp))
72
73
74 ;;; @ end
75 ;;;
76
77 (provide 'mime-def)
78
79 ;;; mime-def.el ends here