Variable `tm:warning-face' was renamed to `eword-warning-face'.
[elisp/semi.git] / mime-def.el
index 347d932..dc5bce7 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: mime-def.el,v 0.0 1997-02-24 01:43:06 morioka Exp $
+;; Version: $Id: mime-def.el,v 0.12 1997-02-25 06:35:05 tmorioka Exp $
 ;; Keywords: definition, MIME, multimedia, mail, news
 
 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
 (defconst mime/temp-buffer-name " *MIME-temp*")
 
 
-;;; @ charset and encoding
-;;;
-
-(defvar mime-charset-type-list
-  '((us-ascii          7 nil)
-    (iso-8859-1                8 "quoted-printable")
-    (iso-8859-2                8 "quoted-printable")
-    (iso-8859-3                8 "quoted-printable")
-    (iso-8859-4                8 "quoted-printable")
-    (iso-8859-5                8 "quoted-printable")
-    (koi8-r            8 "quoted-printable")
-    (iso-8859-7                8 "quoted-printable")
-    (iso-8859-8                8 "quoted-printable")
-    (iso-8859-9                8 "quoted-printable")
-    (iso-2022-jp       7 "base64")
-    (iso-2022-kr       7 "base64")
-    (euc-kr            8 "base64")
-    (gb2312            8 "quoted-printable")
-    (big5              8 "base64")
-    (iso-2022-jp-2     7 "base64")
-    (iso-2022-int-1    7 "base64")
-    ))
-
-(defun mime/encoding-name (transfer-level &optional not-omit)
-  (cond ((> transfer-level 8) "binary")
-       ((= transfer-level 8) "8bit")
-       (not-omit "7bit")
-       ))
-
-(defun mime/make-charset-default-encoding-alist (transfer-level)
-  (mapcar (function
-          (lambda (charset-type)
-            (let ((charset  (upcase (symbol-name (car charset-type))))
-                  (type     (nth 1 charset-type))
-                  (encoding (nth 2 charset-type))
-                  )
-              (if (<= type transfer-level)
-                  (cons charset (mime/encoding-name type))
-                (cons charset encoding)
-                ))))
-         mime-charset-type-list))
-
-
 ;;; @ button
 ;;;
 
-(defun tm:set-face-region (b e face)
-  (let ((overlay (tl:make-overlay b e)))
-    (tl:overlay-put overlay 'face face)
-    ))
-
 (defvar tm:button-face 'bold
   "Face used for content-button or URL-button of MIME-Preview buffer.
 \[mime-def.el]")
 (defvar tm:mouse-face 'highlight
   "Face used for MIME-preview buffer mouse highlighting. [mime-def.el]")
 
-(defvar tm:warning-face nil
-  "Face used for invalid encoded-word.")
-
 (defun tm:add-button (from to func &optional data)
   "Create a button between FROM and TO with callback FUNC and data DATA."
   (and tm:button-face
@@ -215,7 +164,7 @@ FUNCTION.")
 
 (defconst mime/tspecials "][\000-\040()<>@,\;:\\\"/?.=")
 (defconst mime/token-regexp (concat "[^" mime/tspecials "]+"))
-(defconst mime/charset-regexp mime/token-regexp)
+(defconst mime-charset-regexp mime/token-regexp)
 
 (defconst mime/content-type-subtype-regexp
   (concat mime/token-regexp "/" mime/token-regexp))
@@ -223,43 +172,6 @@ FUNCTION.")
 (defconst mime/disposition-type-regexp mime/token-regexp)
 
 
-;;; @@ Base64
-;;;
-
-(defconst base64-token-regexp "[A-Za-z0-9+/]")
-(defconst base64-token-padding-regexp "[A-Za-z0-9+/=]")
-
-(defconst mime/B-encoded-text-regexp
-  (concat "\\(\\("
-         base64-token-regexp
-         base64-token-regexp
-         base64-token-regexp
-         base64-token-regexp
-         "\\)*"
-         base64-token-regexp
-         base64-token-regexp
-         base64-token-padding-regexp
-         base64-token-padding-regexp
-          "\\)"))
-
-(defconst mime/B-encoding-and-encoded-text-regexp
-  (concat "\\(B\\)\\?" mime/B-encoded-text-regexp))
-
-
-;;; @@ Quoted-Printable
-;;;
-
-(defconst quoted-printable-hex-chars "0123456789ABCDEF")
-(defconst quoted-printable-octet-regexp
-  (concat "=[" quoted-printable-hex-chars
-         "][" quoted-printable-hex-chars "]"))
-
-(defconst mime/Q-encoded-text-regexp
-  (concat "\\([^=?]\\|" quoted-printable-octet-regexp "\\)+"))
-(defconst mime/Q-encoding-and-encoded-text-regexp
-  (concat "\\(Q\\)\\?" mime/Q-encoded-text-regexp))
-
-
 ;;; @ rot13-47
 ;;;
 ;; caesar-region written by phr@prep.ai.mit.edu  Nov 86
@@ -382,6 +294,16 @@ ROT47 will be performed for Japanese text in any case."
     ))
 
 
+;;; @ RCS version
+;;;
+
+(defsubst get-version-string (id)
+  "Return a version-string from RCS ID."
+  (and (string-match ",v \\([0-9][0-9.][0-9.]+\\)" id)
+       (substring id (match-beginning 1)(match-end 1))
+       ))
+
+
 ;;; @ end
 ;;;