annotate lisp/mel/mel-g.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents
children 4b173ad71786
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 ;;; mel-g.el: Gzip64 encoder/decoder for GNU Emacs
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
3 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 ;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;;; Copyright (C) 1996 Shuhei KOBAYASHI
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 ;;; Author: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 ;;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 ;;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 ;;; Created: 1995/10/25
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 ;;; Version:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;;; $Id: mel-g.el,v 1.1.1.1 1996/12/18 03:55:30 steve Exp $
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;;; Keywords: MIME, base64, gzip
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 ;;; This file is not part of MEL (MIME Encoding Library) yet.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 ;;; This program is free software; you can redistribute it and/or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;;; modify it under the terms of the GNU General Public License as
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 ;;; published by the Free Software Foundation; either version 2, or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 ;;; (at your option) any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 ;;; This program is distributed in the hope that it will be useful,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 ;;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 ;;; You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 ;;; along with This program. If not, write to the Free Software
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 (require 'emu)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 ;;; @ variables
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (defvar gzip64-external-encoder '("sh" "-c" "gzip -c | mmencode")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 "*list of gzip64 encoder program name and its arguments.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 (defvar gzip64-external-decoder '("sh" "-c" "mmencode -u | gzip -dc")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 "*list of gzip64 decoder program name and its arguments.")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 ;;; @ encoder/decoder for region
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 (defun gzip64-external-encode-region (beg end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 (interactive "*r")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 (as-binary-process (apply (function call-process-region)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 beg end (car gzip64-external-encoder)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 t t nil (cdr gzip64-external-encoder))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 ;; for OS/2
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 ;; regularize line break code
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 (goto-char (point-min))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 (while (re-search-forward "\r$" nil t)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 (replace-match "")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 (defun gzip64-external-decode-region (beg end)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65 (interactive "*r")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66 (save-excursion
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 (as-binary-process (apply (function call-process-region)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 beg end (car gzip64-external-decoder)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 t t nil (cdr gzip64-external-decoder))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73 (defalias 'gzip64-encode-region 'gzip64-external-encode-region)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74 (defalias 'gzip64-decode-region 'gzip64-external-decode-region)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77 ;;; @ encoder/decoder for file
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 (defun gzip64-insert-encoded-file (filename)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
81 (interactive (list (read-file-name "Insert encoded file: ")))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
82 (apply (function call-process) (car gzip64-external-encoder)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
83 filename t nil
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
84 (cdr gzip64-external-encoder))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
85 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
86
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
87
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
88 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
89 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
90
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
91 (provide 'mel-g)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
92
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
93 ;;; mel-g.el ends here.