`make-temp-name'.
* pgg-pgp5.el (pgg-pgp5-process-region): Ditto.
(pgg-scheme-verify-region): Ditto.
(pgg-scheme-snarf-keys-region): Ditto.
* pgg-pgp.el (pgg-pgp-process-region): Ditto.
(pgg-scheme-verify-region): Ditto.
(pgg-scheme-snarf-keys-region): Ditto.
* smime.el (smime-process-region): Ditto.
(smime-verify-region): Ditto.
* mime-pgp.el (mime-verify-application/pgp-signature): Ditto.
(mime-verify-application/pkcs7-signature): Ditto.
* mime-play.el (mime-activate-mailcap-method): Make a temporary
directory of a temporary file for the mailcap application.
(mime-mailcap-method-sentinel): Follow the change above.
(mime-store-message/partial-piece): Set `default-file-modes' for
`make-directory'.
* mime-edit.el (mime-edit-split-and-send): Remove local variable
`mime-edit-draft-file-name'.
+2003-05-15 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * pgg-gpg.el (pgg-gpg-process-region): Use `make-temp-file' instead of
+ `make-temp-name'.
+
+ * pgg-pgp5.el (pgg-pgp5-process-region): Ditto.
+ (pgg-scheme-verify-region): Ditto.
+ (pgg-scheme-snarf-keys-region): Ditto.
+
+ * pgg-pgp.el (pgg-pgp-process-region): Ditto.
+ (pgg-scheme-verify-region): Ditto.
+ (pgg-scheme-snarf-keys-region): Ditto.
+
+ * smime.el (smime-process-region): Ditto.
+ (smime-verify-region): Ditto.
+
+ * mime-pgp.el (mime-verify-application/pgp-signature): Ditto.
+ (mime-verify-application/pkcs7-signature): Ditto.
+
+ * mime-play.el (mime-activate-mailcap-method): Make a temporary
+ directory of a temporary file for the mailcap application.
+ (mime-mailcap-method-sentinel): Follow the change above.
+ (mime-store-message/partial-piece): Set `default-file-modes' for
+ `make-directory'.
+
+ * mime-edit.el (mime-edit-split-and-send): Remove local variable
+ `mime-edit-draft-file-name'.
+
2003-05-12 Yoichi NAKAYAMA <yoichi@geiin.org>
* mime-edit.el (turn-on-mime-edit): Protect 1st arg of `message'.
(or (cdr (assq major-mode mime-edit-message-max-lines-alist))
mime-edit-message-default-max-lines))
)
- (let* ((mime-edit-draft-file-name
- (or (buffer-file-name)
- (make-temp-name
- (expand-file-name "mime-draft" temporary-file-directory))))
- (separator mail-header-separator)
+ (let* ((separator mail-header-separator)
(id (concat "\""
(replace-space-with-underline (current-time-string))
"@" (system-name) "\"")))
(1- knum)
(1+ knum)))
(orig-entity (nth onum (mime-entity-children mother)))
- (basename (expand-file-name "tm" temporary-file-directory))
- (sig-file (concat (make-temp-name basename) ".asc"))
+ (sig-file (make-temp-file "tm" nil ".asc"))
status)
(save-excursion
(mime-show-echo-buffer)
(1- knum)
(1+ knum)))
(orig-entity (nth onum (mime-entity-children mother)))
- (basename (expand-file-name "tm" temporary-file-directory))
- (sig-file (concat (make-temp-name basename) ".asc"))
+ (sig-file (make-temp-file "tm" nil ".asc"))
status)
(save-excursion
(mime-show-echo-buffer)
(defun mime-activate-mailcap-method (entity situation)
(let ((method (cdr (assoc 'method situation)))
(name (mime-entity-safe-filename entity)))
- (setq name
- (if (and name (not (string= name "")))
- (expand-file-name name temporary-file-directory)
- (make-temp-name
- (expand-file-name "EMI" temporary-file-directory))))
+ (setq name (expand-file-name (if (and name (not (string= name "")))
+ name
+ (make-temp-name "EMI"))
+ (make-temp-file "EMI" 'directory)))
(mime-write-entity-content entity name)
(message "External method is starting...")
(let ((process
(defun mime-mailcap-method-sentinel (process event)
(let ((file (cdr (assq process mime-mailcap-method-filename-alist))))
- (if (file-exists-p file)
+ (when (file-exists-p file)
+ (ignore-errors
(delete-file file)
- ))
+ (delete-directory (file-name-directory file)))))
(remove-alist 'mime-mailcap-method-filename-alist process)
(message "%s %s" process event))
(number (cdr (assoc "number" cal)))
(total (cdr (assoc "total" cal)))
file
- (mother (current-buffer)))
+ (mother (current-buffer))
+ orig-modes (default-file-modes))
(or (file-exists-p root-dir)
- (make-directory root-dir))
+ (unwind-protect
+ (progn
+ (set-default-file-modes 448)
+ (make-directory root-dir))
+ (set-default-file-modes orig-modes)))
(setq id (replace-as-filename id))
(setq root-dir (concat root-dir "/" id))
+
(or (file-exists-p root-dir)
- (make-directory root-dir))
+ (unwind-protect
+ (progn
+ (set-default-file-modes 448)
+ (make-directory root-dir))
+ (set-default-file-modes orig-modes)))
+
(setq file (concat root-dir "/FULL"))
(if (file-exists-p file)
(let ((full-buf (get-buffer-create "FULL"))
(luna-make-entity 'pgg-scheme-gpg))))
(defun pgg-gpg-process-region (start end passphrase program args)
- (let* ((output-file-name
- (concat temporary-file-directory (make-temp-name "pgg-output")))
+ (let* ((output-file-name (make-temp-file "pgg-output"))
(args
`("--status-fd" "2"
,@(if passphrase '("--passphrase-fd" "0"))
(luna-make-entity 'pgg-scheme-pgp))))
(defun pgg-pgp-process-region (start end passphrase program args)
- (let* ((errors-file-name
- (concat temporary-file-directory
- (make-temp-name "pgg-errors")))
+ (let* ((errors-file-name (make-temp-file "pgg-errors"))
(args
(append args
pgg-pgp-extra-args
(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp)
start end &optional signature)
- (let* ((basename (expand-file-name "pgg" temporary-file-directory))
- (orig-file (make-temp-name basename))
+ (let* ((orig-file (make-temp-file "pgg"))
(args '("+verbose=1" "+batchmode" "+language=us"))
(orig-mode (default-file-modes)))
(unwind-protect
(luna-define-method pgg-scheme-snarf-keys-region ((scheme pgg-scheme-pgp)
start end)
(let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
- (basename (expand-file-name "pgg" temporary-file-directory))
- (key-file (make-temp-name basename))
+ (key-file (make-temp-file "pgg"))
(args
(list "+verbose=1" "+batchmode" "+language=us" "-kaf"
key-file)))
(luna-make-entity 'pgg-scheme-pgp5))))
(defun pgg-pgp5-process-region (start end passphrase program args)
- (let* ((errors-file-name
- (concat temporary-file-directory
- (make-temp-name "pgg-errors")))
+ (let* ((errors-file-name (make-temp-file "pgg-errors"))
(args
(append args
pgg-pgp5-extra-args
(luna-define-method pgg-scheme-verify-region ((scheme pgg-scheme-pgp5)
start end &optional signature)
- (let* ((basename (expand-file-name "pgg" temporary-file-directory))
- (orig-file (make-temp-name basename))
+ (let* ((orig-file (make-temp-file "pgg"))
(args '("+verbose=1" "+batchmode=1" "+language=us"))
(orig-mode (default-file-modes)))
(unwind-protect
(luna-define-method pgg-scheme-snarf-keys-region ((scheme pgg-scheme-pgp5)
start end)
(let* ((pgg-pgp5-user-id (or pgg-pgp5-user-id pgg-default-user-id))
- (basename (expand-file-name "pgg" temporary-file-directory))
- (key-file (make-temp-name basename))
+ (key-file (make-temp-file "pgg"))
(args
(list "+verbose=1" "+batchmode=1" "+language=us" "-a"
key-file)))
(pop files)))))
(defun smime-process-region (start end program args)
- (let* ((errors-file-name
- (concat temporary-file-directory
- (make-temp-name "smime-errors")))
+ (let* ((errors-file-name (make-temp-file "smime-errors"))
(args (append args (list (concat "2>" errors-file-name))))
(shell-file-name smime-shell-file-name)
(shell-command-switch smime-shell-command-switch)
"Verify the current region between START and END.
If the optional 3rd argument SIGNATURE is non-nil, it is treated as
the detached signature of the current region."
- (let* ((basename (expand-file-name "smime" temporary-file-directory))
- (orig-file (make-temp-name basename))
+ (let* ((orig-file (make-temp-file "smime"))
(orig-mode (default-file-modes)))
(unwind-protect
(progn