summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-util.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/eshell/esh-util.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/eshell/esh-util.el')
-rw-r--r--lisp/eshell/esh-util.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 5286f280b39..3bb6e8f31c7 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -539,20 +539,17 @@ Unless optional argument INPLACE is non-nil, return a new string."
(defmacro eshell-with-file-modes (modes &rest forms)
"Evaluate, with file-modes set to MODES, the given FORMS."
- `(let ((modes (default-file-modes)))
- (set-default-file-modes ,modes)
- (unwind-protect
- (progn ,@forms)
- (set-default-file-modes modes))))
+ (declare (obsolete with-file-modes "24.5"))
+ `(with-file-modes ,modes ,@forms))
(defmacro eshell-with-private-file-modes (&rest forms)
"Evaluate FORMS with private file modes set."
- `(eshell-with-file-modes ,eshell-private-file-modes ,@forms))
+ `(with-file-modes ,eshell-private-file-modes ,@forms))
(defsubst eshell-make-private-directory (dir &optional parents)
"Make DIR with file-modes set to `eshell-private-directory-modes'."
- (eshell-with-file-modes eshell-private-directory-modes
- (make-directory dir parents)))
+ (with-file-modes eshell-private-directory-modes
+ (make-directory dir parents)))
(defsubst eshell-substring (string sublen)
"Return the beginning of STRING, up to SUBLEN bytes."