Fixed.
[elisp/semi.git] / mime-mc.el
index 75ba129..65e2971 100644 (file)
@@ -1,12 +1,11 @@
 ;;; mime-mc.el --- Mailcrypt interface for SEMI
 
-;; Copyright (C) 1996,1997 MORIOKA Tomohiko
+;; Copyright (C) 1996,1997,1998 MORIOKA Tomohiko
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: mime-mc.el,v 0.0 1997-02-27 08:03:48 tmorioka Exp $
 ;; Keywords: PGP, security, MIME, multimedia, mail, news
 
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of SEMI (Secure Emacs MIME Interface).
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
 
 ;; 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.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Code:
 
 (require 'mailcrypt)
-(load "mc-pgp")
+(eval-and-compile (load "mc-pgp"))
 
 (defun mime-mc-pgp-generic-parser (result)
   (let ((ret (mc-pgp-generic-parser result)))
     (if (consp ret)
-       (vector (car ret)(cdr ret))
-      )))
+       (vector (car ret)(cdr ret)))))
 
 (defun mime-mc-process-region
   (beg end passwd program args parser &optional buffer boundary)
@@ -88,12 +86,10 @@ Content-Transfer-Encoding: 7bit
 " boundary))
                        (insert-buffer-substring mybuf (car rgn) (cdr rgn))
                        (goto-char (point-max))
-                       (insert (format "\n--%s--\n" boundary))
-                       )
+                       (insert (format "\n--%s--\n" boundary)))
                    (delete-region beg end)
                    (goto-char beg)
-                   (insert-buffer-substring mybuf (car rgn) (cdr rgn))
-                   )
+                   (insert-buffer-substring mybuf (car rgn) (cdr rgn)))
                  (set-buffer mybuf)
                  (delete-region (car rgn) (cdr rgn)))))
          ;; Return nil on failure and exit code on success
@@ -112,8 +108,7 @@ Content-Transfer-Encoding: 7bit
        (buffer (get-buffer-create mc-buffer-name))
        passwd args key
        (parser (function mc-pgp-generic-parser))
-       (pgp-path mc-pgp-path)
-       )
+       (pgp-path mc-pgp-path))
     (setq key (mc-pgp-lookup-key (or id mc-pgp-user-id)))
     (setq passwd
          (mc-activate-passwd
@@ -129,9 +124,8 @@ Content-Transfer-Encoding: 7bit
                 (format "+clearsig=%s" (if unclear "off" "on"))
                 "+batchmode" "-u" (cdr key))))
     (if mc-pgp-comment
-       (setq args (cons (format "+comment=%s" mc-pgp-comment) args))
-      )
-    (message "Signing as %s ..." (car key))
+       (setq args (cons (format "+comment=%s" mc-pgp-comment) args)))
+    (message "Signing as %s..." (car key))
     (if (mime-mc-process-region
         start end passwd pgp-path args parser buffer boundary)
        (progn
@@ -143,7 +137,7 @@ Content-Transfer-Encoding: 7bit
 --[[multipart/signed; protocol=\"application/pgp-signature\";
  boundary=\"%s\"; micalg=pgp-md5][7bit]]\n" boundary))
                ))
-         (message "Signing as %s ... Done." (car key))
+         (message "Signing as %s...done" (car key))
          t)
       nil)))
 
@@ -153,8 +147,7 @@ Content-Transfer-Encoding: 7bit
                              'never)))
     (mc-pgp-encrypt-region
      (mc-split "\\([ \t\n]*,[ \t\n]*\\)+" recipients)
-     start end id nil)
-    ))
+     start end id nil)))
 
                
 ;;; @ end