X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-nemacs.el;h=aad22496ce4a2e94c7905e091e0490ded7d7f834;hb=30643c84ac4aa5809c1fc63ef8844f1edba7dbff;hp=a873fad27fd922db994d64a9f43cf3d021e57d7c;hpb=a2830b103396ae7af01c96e33f5b4f5df71a7b0a;p=elisp%2Ftm.git diff --git a/tm-nemacs.el b/tm-nemacs.el index a873fad..aad2249 100644 --- a/tm-nemacs.el +++ b/tm-nemacs.el @@ -1,6 +1,31 @@ ;;; -;;; $Id: tm-nemacs.el,v 6.1 1995/08/26 18:44:31 morioka Exp $ +;;; tm-nemacs.el --- tm definitions depended on NEmacs ;;; +;;; Copyright (C) 1995 Free Software Foundation, Inc. +;;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko +;;; +;;; Author: MORIOKA Tomohiko +;;; Version: +;;; $Id: tm-nemacs.el,v 7.6 1996/01/11 05:12:50 morioka Exp $ +;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word +;;; +;;; 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. +;;; +;;; Code: (require 'emu) @@ -8,60 +33,48 @@ ;;; @ variables ;;; -(defvar mime/default-coding-system 2) +(defvar mime/default-coding-system *junet*) -(defvar mime/lc-charset-and-encoding-alist +(defvar mime/lc-charset-alist (list - (cons lc-ascii nil) - (cons lc-jp '("ISO-2022-JP" . "B")) + (cons (list lc-ascii) "US-ASCII") + (cons (list lc-ascii lc-jp) "ISO-2022-JP") )) -(defvar mime/latin-lc-list - (list lc-ascii)) - -;; by mol. 1993/10/4 +(defvar mime/unknown-charset "ISO-2022-JP") + + +;;; @ functions +;;; + (defun mime/convert-string-to-emacs (charset str) - (cond ((string-match "^ISO-2022-JP$" charset) - (convert-string-kanji-code str 2 3)) - ((string-match "^US-ASCII$" charset) str) + (cond ((string= "ISO-2022-JP" charset) + (code-convert-string str *junet* *internal*)) + ((string= "US-ASCII" charset) str) ((string-match "^ISO-8859-[1-9]$" charset) (check-ASCII-string str)) - (t nil) )) -;; by mol. 1993/11/2 (defun mime/convert-string-from-emacs (string charset) - (cond ((equal charset "ISO-2022-JP") + (cond ((string= charset "ISO-2022-JP") (code-convert-string string *internal* *junet*)) - ((equal charset "US-ASCII") string) - (t nil) + ((string= charset "US-ASCII") string) )) -;; by mol. 1993/10/4 -(defun mime/decode-encoded-text (charset encoding str) - (let ((ds (mime/convert-string-to-emacs - charset - (cond ((string-match "^B$" encoding) - (mime/base64-decode-string str)) - ((string-match "^Q$" encoding) - (mime/Quoted-Printable-decode-string str)) - (t - (message "unknown encoding %s" encoding) - (concat "=?" charset "?" encoding "?" str "?=") - ))))) - (if ds - ds - (concat "=?" charset "?" encoding "?" str "?=")) - )) - (defun mime/code-convert-region-to-emacs (beg end charset &optional encoding) (if (stringp charset) (progn (setq charset (upcase charset)) (if (string= charset "ISO-2022-JP") - (convert-region-kanji-code beg end 2 3) + (code-convert-region beg end *junet* *internal*) )))) -(run-hooks 'tm-nemacs-load-hook) + +;;; @ end +;;; (provide 'tm-nemacs) + +(run-hooks 'tm-nemacs-load-hook) + +;;; tm-nemacs.el ends here