summaryrefslogtreecommitdiff
path: root/lisp/obsolete/pgg-pgp5.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-05-14 10:15:15 -0700
committerGlenn Morris <rgm@gnu.org>2014-05-14 10:15:15 -0700
commitd63d883a97e385392a12a5155201417dea7437ec (patch)
tree7141dda616156ada1c5935d49dfc9e6915a5857b /lisp/obsolete/pgg-pgp5.el
parentabad7b05fa544e5dfccf240180c37157dd92ac54 (diff)
downloademacs-d63d883a97e385392a12a5155201417dea7437ec.tar.gz
Add with-file-modes macro, and use it
* lisp/subr.el (with-file-modes): New macro. * lisp/printing.el (pr-save-file-modes): * lisp/eshell/esh-util.el (eshell-with-file-modes): Make obsolete. * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Add with-file-modes. * lisp/doc-view.el (doc-view-make-safe-dir): * lisp/epg.el (epg--start): * lisp/files.el (locate-user-emacs-file, make-temp-file) (backup-buffer-copy, move-file-to-trash): * printing.el (pr-despool-print, pr-call-process, pr-text2ps): * eshell/esh-util.el (eshell-with-private-file-modes) (eshell-make-private-directory): * lisp/net/browse-url.el (browse-url-mosaic): * lisp/obsolete/mailpost.el (post-mail-send-it): * lisp/obsolete/pgg-pgp.el (pgg-pgp-verify-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-verify-region): * lisp/url/url-util.el (url-make-private-file): Use with-file-modes. * doc/lispref/files.texi (Changing Files): Mention with-file-modes. * etc/NEWS: Mention this.
Diffstat (limited to 'lisp/obsolete/pgg-pgp5.el')
-rw-r--r--lisp/obsolete/pgg-pgp5.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/obsolete/pgg-pgp5.el b/lisp/obsolete/pgg-pgp5.el
index beece7ea2ea..944800cf0f6 100644
--- a/lisp/obsolete/pgg-pgp5.el
+++ b/lisp/obsolete/pgg-pgp5.el
@@ -208,15 +208,11 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
(defun pgg-pgp5-verify-region (start end &optional signature)
"Verify region between START and END as the detached signature SIGNATURE."
(let ((orig-file (pgg-make-temp-file "pgg"))
- (args '("+verbose=1" "+batchmode=1" "+language=us"))
- (orig-mode (default-file-modes)))
- (unwind-protect
- (progn
- (set-default-file-modes 448)
- (let ((coding-system-for-write 'binary)
- jka-compr-compression-info-list jam-zcat-filename-list)
- (write-region start end orig-file)))
- (set-default-file-modes orig-mode))
+ (args '("+verbose=1" "+batchmode=1" "+language=us")))
+ (with-file-modes 448
+ (let ((coding-system-for-write 'binary)
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (write-region start end orig-file)))
(when (stringp signature)
(copy-file signature (setq signature (concat orig-file ".asc")))
(setq args (append args (list signature))))