X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-def.el;h=7d341d0639d58244de6ba439608c0b1d2f6351b1;hb=86824724a2d5325e296ee93a1abb3952d2320a20;hp=f2c373a1917670e9ed3ee6e69db5c5a7617a1ca7;hpb=79aebb76e3a8f57deb7559a3d15ab760de33d75b;p=elisp%2Ftm.git diff --git a/tm-def.el b/tm-def.el index f2c373a..7d341d0 100644 --- a/tm-def.el +++ b/tm-def.el @@ -1,34 +1,31 @@ -;;; ;;; tm-def.el --- definition module for tm -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1995,1996 MORIOKA Tomohiko -;;; -;;; Author: MORIOKA Tomohiko -;;; Version: -;;; $Id: tm-def.el,v 7.55 1996/07/11 15:26:54 morioka Exp $ -;;; Keywords: mail, news, MIME, multimedia, definition -;;; -;;; This file is part of tm (Tools for MIME). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; + +;; Copyright (C) 1995,1996 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; Version: $Id: tm-def.el,v 7.66 1996/11/26 18:00:45 shuhei-k Exp $ +;; Keywords: mail, news, MIME, multimedia, definition + +;; This file is part of tm (Tools for MIME). + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + ;;; Code: (require 'emu) -(require 'tl-822) ;;; @ variables @@ -45,6 +42,9 @@ (function find-file) )) +(defvar mime/output-buffer-window-is-shared-with-bbdb t + "*If t, mime/output-buffer window is shared with BBDB window.") + ;;; @ constants ;;; @@ -70,6 +70,7 @@ (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") @@ -95,66 +96,6 @@ mime-charset-type-list)) -;;; @ coding-system -;;; - -(defvar mime/charset-coding-system-alist - (let* (csl - (f (if (and running-xemacs-20 (featurep 'mule)) - (progn - (setq csl (coding-system-list)) - (function - (lambda (a cell) - (if (memq (cdr cell) csl) - (cons cell a) - a)))) - (function - (lambda (a cell) - (let ((sym (symbol-concat "*" (cdr cell) "*"))) - (if (boundp sym) - (cons (cons (car cell) (symbol-value sym)) a) - a)))) - ))) - (foldr f nil - '(("ISO-2022-JP" . junet) - ("ISO-2022-KR" . iso-2022-kr) - ("EUC-KR" . euc-kr) - ("GB2312" . euc-china) - ("ISO-8859-1" . ctext) - ("ISO-8859-2" . iso-8859-2) - ("ISO-8859-3" . iso-8859-3) - ("ISO-8859-4" . iso-8859-4) - ("ISO-8859-5" . iso-8859-5) - ("KOI8-R" . koi8) - ("ISO-8859-7" . iso-8859-7) - ("ISO-8859-8" . iso-8859-8) - ("ISO-8859-9" . iso-8859-9) - ("ISO-2022-JP-2" . iso-2022-ss2-7) - ("X-ISO-2022-JP-2" . iso-2022-ss2-7) - ("ISO-2022-INT-1" . iso-2022-int-1) - ("SHIFT_JIS" . sjis) - ("X-SHIFTJIS" . sjis) - ("BIG5" . big5) - )))) - -(defvar mime/default-coding-system *ctext*) - -(defun mime-charset-decode-string (str charset) - (let ((cs (assoc charset mime/charset-coding-system-alist))) - (if cs - (character-decode-string str (cdr cs)) - ))) - -(defun mime-charset-decode-region (beg end charset &optional encoding) - (let ((ct - (if (stringp charset) - (cdr (assoc (upcase charset) mime/charset-coding-system-alist)) - mime/default-coding-system))) - (if ct - (character-decode-region beg end ct) - ))) - - ;;; @ button ;;; @@ -183,11 +124,18 @@ (defun tm:button-dispatcher (event) "Select the button under point." (interactive "e") - (save-window-excursion - (mouse-set-point event) - (let ((func (get-text-property (point) 'tm-callback)) - (data (get-text-property (point) 'tm-data)) - ) + (let (buf point func data) + (save-window-excursion + (mouse-set-point event) + (setq buf (current-buffer) + point (point) + func (get-text-property (point) 'tm-callback) + data (get-text-property (point) 'tm-data) + ) + ) + (save-excursion + (set-buffer buf) + (goto-char point) (if func (apply func data) (if (fboundp tm:mother-button-dispatcher) @@ -224,10 +172,6 @@ (defconst mime/content-type-subtype-regexp (concat mime/token-regexp "/" mime/token-regexp)) -(defconst mime/content-parameter-value-regexp - (concat "\\(" - rfc822/quoted-string-regexp - "\\|[^; \t\n]*\\)")) (defconst mime/disposition-type-regexp mime/token-regexp) @@ -236,14 +180,21 @@ ;;; (defconst base64-token-regexp "[A-Za-z0-9+/=]") +(defconst base64-token-padding-regexp "[A-Za-z0-9+/=]") (defconst mime/B-encoded-text-regexp - (concat "\\(" + (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))