X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=epg-file.el;h=17c2dd490e6fa7737482e7bc3cff27147962c610;hb=08eb93f7db855053a3366e562657ff6c9a80bd58;hp=fc2123fda4f55641d8fdab1893599f3e1b3086d5;hpb=c3ac2d6d6c872f7cb42fd87bcdf5894d7c34b5ca;p=elisp%2Fepg.git diff --git a/epg-file.el b/epg-file.el index fc2123f..17c2dd4 100644 --- a/epg-file.el +++ b/epg-file.el @@ -32,7 +32,8 @@ with GnuPG." (epg-file-run-real-handler 'write-region (list start end "/")) (file-error (if (boundp 'last-coding-system-used) - last-coding-system-used)))) + last-coding-system-used + buffer-file-coding-system)))) ;; start and end are normally buffer positions ;; specifying the part of the buffer to write. ;; If start is nil, that means to use the entire buffer contents. @@ -66,8 +67,15 @@ with GnuPG." (let ((coding-system-for-write 'binary) (coding-system-for-read 'binary) (context (epg-make-context)) + recipients + string cipher) - (when (setq cipher (epg-encrypt-string context (buffer-string) nil)) + (while (not (equal (setq string + (read-string "To (end with an empty line): ")) + "")) + (setq recipients (cons string recipients))) + (when (setq cipher (epg-encrypt-string context (buffer-string) + recipients)) (if (and (memq system-type '(ms-dos windows-nt)) (boundp 'buffer-file-type)) (setq buffer-file-type t)) @@ -85,8 +93,8 @@ with GnuPG." (when (or (eq visit t) (stringp visit)) (setq buffer-file-name filename) (set-visited-file-modtime)) - (when (stringp visit) - (setq buffer-file-name visit)) + (if (stringp visit) + (setq buffer-file-name visit)) (when (or (eq visit t) (eq visit nil) (stringp visit)) (message "Wrote %s" visit-file)) (if (boundp 'last-coding-system-used) @@ -151,3 +159,7 @@ with GnuPG." (setq auto-mode-alist (cons (list epg-file-name-regexp nil 'strip-suffix) auto-mode-alist))) + +(provide 'epg-file) + +;;; epg-file.el ends here