From 8a9b395fb714c8237669f9ff4d4d7c888acfd4b1 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 3 Oct 2003 03:09:39 +0000 Subject: [PATCH] Synch to Gnus 200310030116. --- lisp/ChangeLog | 2 ++ lisp/mm-decode.el | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 583a994..68b58d1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * mm-decode.el (mm-file-name-delete-control) (mm-file-name-delete-gotchas): New functions. (mm-file-name-rewrite-functions): Use them. + (mm-attachment-file-modes): New option. + (mm-save-part-to-file): Use it. 2003-10-02 Reiner Steib diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index f2abc4d..7212155 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -355,6 +355,11 @@ If not set, `default-directory' will be used." :type '(choice directory (const :tag "Default" nil)) :group 'mime-display) +(defcustom mm-attachment-file-modes ?\600 + "Set the mode bits of saved attachments to this integer." + :type 'integer + :group 'mime-display) + (defcustom mm-external-terminal-program "xterm" "The program to start an external terminal." :type 'string @@ -1060,13 +1065,17 @@ string if you do not like underscores." (mm-with-unibyte-buffer (mm-insert-part handle) (let ((coding-system-for-write 'binary) + (current-file-modes (default-file-modes)) ;; Don't re-compress .gz & al. Arguably we should make ;; `file-name-handler-alist' nil, but that would chop ;; ange-ftp, which is reasonable to use here. (inhibit-file-name-operation 'write-region) (inhibit-file-name-handlers (cons 'jka-compr-handler inhibit-file-name-handlers))) - (write-region (point-min) (point-max) file)))) + (set-default-file-modes mm-attachment-file-modes) + (unwind-protect + (write-region (point-min) (point-max) file) + (set-default-file-modes current-file-modes))))) (defun mm-pipe-part (handle) "Pipe HANDLE to a process." -- 1.7.10.4