* mime-pgp.el: Require 'epg.
[elisp/semi.git] / mime-mc.el
index 78dfdae..65e2971 100644 (file)
 
 ;; 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)
@@ -87,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
@@ -111,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
@@ -128,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
@@ -142,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)))
 
@@ -152,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