Mercurial > hg > xemacs-beta
comparison lisp/mel/mel.el @ 10:49a24b4fd526 r19-15b6
Import from CVS: tag r19-15b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:47:52 +0200 |
parents | 4b173ad71786 |
children | 7e54bd776075 |
comparison
equal
deleted
inserted
replaced
9:6f2bbbbbe05a | 10:49a24b4fd526 |
---|---|
3 ;; Copyright (C) 1995,1996 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1995,1996 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | 5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
6 ;; modified by Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> | 6 ;; modified by Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> |
7 ;; Created: 1995/6/25 | 7 ;; Created: 1995/6/25 |
8 ;; Version: $Id: mel.el,v 1.2 1996/12/22 00:29:16 steve Exp $ | 8 ;; Version: $Id: mel.el,v 1.3 1996/12/29 00:14:58 steve Exp $ |
9 ;; Keywords: MIME, Base64, Quoted-Printable, uuencode, gzip64 | 9 ;; Keywords: MIME, Base64, Quoted-Printable, uuencode, gzip64 |
10 | 10 |
11 ;; This file is part of MEL (MIME Encoding Library). | 11 ;; This file is part of MEL (MIME Encoding Library). |
12 | 12 |
13 ;; This program is free software; you can redistribute it and/or | 13 ;; This program is free software; you can redistribute it and/or |
41 ("x-uue" . uuencode-encode-region) | 41 ("x-uue" . uuencode-encode-region) |
42 ("x-gzip64" . gzip64-encode-region) | 42 ("x-gzip64" . gzip64-encode-region) |
43 ("7bit") | 43 ("7bit") |
44 ("8bit") | 44 ("8bit") |
45 ("binary") | 45 ("binary") |
46 )) | 46 ) |
47 "Alist of encoding vs. corresponding method to encode region. | |
48 Each element looks like (STRING . FUNCTION) or (STRING . nil). | |
49 STRING is content-transfer-encoding. | |
50 FUNCTION is region encoder and nil means not to encode. [mel.el]") | |
51 | |
47 | 52 |
48 (autoload 'base64-decode-region "mel-b" nil t) | 53 (autoload 'base64-decode-region "mel-b" nil t) |
49 (autoload 'quoted-printable-decode-region "mel-q" nil t) | 54 (autoload 'quoted-printable-decode-region "mel-q" nil t) |
50 (autoload 'uuencode-decode-region "mel-u" nil t) | 55 (autoload 'uuencode-decode-region "mel-u" nil t) |
51 (autoload 'gzip64-decode-region "mel-g" nil t) | 56 (autoload 'gzip64-decode-region "mel-g" nil t) |
52 | 57 |
53 (defvar mime-decoding-method-alist | 58 (defvar mime-decoding-method-alist |
54 '(("base64" . base64-decode-region) | 59 '(("base64" . base64-decode-region) |
55 ("quoted-printable" . quoted-printable-decode-region) | 60 ("quoted-printable" . quoted-printable-decode-region) |
56 ("x-uue" . uuencode-decode-region) | 61 ("x-uue" . uuencode-decode-region) |
62 ("x-uuencode" . uuencode-decode-region) | |
57 ("x-gzip64" . gzip64-decode-region) | 63 ("x-gzip64" . gzip64-decode-region) |
58 )) | 64 ) |
65 "Alist of encoding vs. corresponding method to decode region. | |
66 Each element looks like (STRING . FUNCTION). | |
67 STRING is content-transfer-encoding. | |
68 FUNCTION is region decoder. [mel.el]") | |
69 | |
59 | 70 |
60 (defun mime-encode-region (beg end encoding) | 71 (defun mime-encode-region (beg end encoding) |
61 "Encode region BEG to END of current buffer using ENCODING. [mel.el]" | 72 "Encode region BEG to END of current buffer using ENCODING. [mel.el]" |
62 (interactive | 73 (interactive |
63 (list (region-beginning) (region-end) | 74 (list (region-beginning) (region-end) |
98 ("x-uue" . uuencode-insert-encoded-file) | 109 ("x-uue" . uuencode-insert-encoded-file) |
99 ("x-gzip64" . gzip64-insert-encoded-file) | 110 ("x-gzip64" . gzip64-insert-encoded-file) |
100 ("7bit" . insert-binary-file-contents-literally) | 111 ("7bit" . insert-binary-file-contents-literally) |
101 ("8bit" . insert-binary-file-contents-literally) | 112 ("8bit" . insert-binary-file-contents-literally) |
102 ("binary" . insert-binary-file-contents-literally) | 113 ("binary" . insert-binary-file-contents-literally) |
103 )) | 114 ) |
115 "Alist of encoding vs. corresponding method to insert encoded file. | |
116 Each element looks like (STRING . FUNCTION). | |
117 STRING is content-transfer-encoding. | |
118 FUNCTION is function to insert encoded file. [mel.el]") | |
119 | |
104 | 120 |
105 (defun mime-insert-encoded-file (filename encoding) | 121 (defun mime-insert-encoded-file (filename encoding) |
106 "Encode region BEG to END of current buffer using ENCODING. [mel.el]" | 122 "Encode region BEG to END of current buffer using ENCODING. [mel.el]" |
107 (interactive | 123 (interactive |
108 (list (read-file-name "Insert encoded file: ") | 124 (list (read-file-name "Insert encoded file: ") |