fixed
[elisp/semi.git] / pgg-gpg.el
index bc1316a..873cff4 100644 (file)
@@ -25,6 +25,7 @@
 
 ;;; Code:
 
+(require 'mel) ; binary-to-text-funcall
 (eval-when-compile (require 'pgg))
 
 (defgroup pgg-gpg ()
     (unwind-protect
        (progn
          (set-default-file-modes 448)
-         (as-binary-output-file
-          (setq process
-                (apply #'start-process "*GnuPG*" errors-buffer program args)))
+         (let ((coding-system-for-write 'binary))
+           (setq process
+                 (apply #'start-process "*GnuPG*" errors-buffer
+                        program args)))
          (set-process-sentinel process #'ignore)
          (when passphrase
            (process-send-string process (concat passphrase "\n")))
@@ -91,7 +93,8 @@
            (buffer-disable-undo)
            (erase-buffer)
            (if (file-exists-p output-file-name)
-               (insert-file-contents-as-raw-text-CRLF output-file-name))
+               (let ((coding-system-for-read 'raw-text-dos))
+                 (insert-file-contents output-file-name)))
            (set-buffer errors-buffer)
            (if (memq status '(stop signal))
                (error "%s exited abnormally: '%s'" program exit-status))
   (let ((args '("--batch" "--verify")))
     (when (stringp signature)
       (setq args (append args (list signature))))
+    (setq args (append args '("-")))
     (pgg-gpg-process-region start end nil pgg-gpg-program args)
     (with-current-buffer pgg-errors-buffer
       (goto-char (point-min))