diff options
| author | ShengHuo ZHU | 2002-03-21 19:11:23 +0000 |
|---|---|---|
| committer | ShengHuo ZHU | 2002-03-21 19:11:23 +0000 |
| commit | 3efe555424e2382bdd49bff9fdcf3043fe7e1484 (patch) | |
| tree | 9ac9c1c41d8460bb1b307f6daa4f870ade960d55 | |
| parent | 3ae1b884632a2c54da5ef6d98df2c96edd1b393b (diff) | |
| download | emacs-3efe555424e2382bdd49bff9fdcf3043fe7e1484.tar.gz emacs-3efe555424e2382bdd49bff9fdcf3043fe7e1484.zip | |
* mail-source.el (make-source-make-complex-temp-name): Use
make-temp-file.
* mm-util.el (mm-make-temp-file): New function.
* nneething.el (nneething-file-name): Use it.
* mm-decode.el (mm-display-external, mm-create-image-xemacs): Ditto.
* gnus-uu.el (gnus-uu-decode-binhex, gnus-uu-decode-binhex-view)
(gnus-uu-digest-mail-forward, gnus-uu-initialize): Ditto.
* gnus-start.el (gnus-slave-save-newsrc): Ditto.
* message.el (message-mode): If buffer-file-name, don't set auto
save file name.
Trivial change from Geoff Greene <ggreene@wpi.edu>
| -rw-r--r-- | lisp/gnus/ChangeLog | 19 | ||||
| -rw-r--r-- | lisp/gnus/gnus-start.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-uu.el | 9 | ||||
| -rw-r--r-- | lisp/gnus/mail-source.el | 17 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 3 | ||||
| -rw-r--r-- | lisp/gnus/mm-decode.el | 8 | ||||
| -rw-r--r-- | lisp/gnus/mm-util.el | 14 | ||||
| -rw-r--r-- | lisp/gnus/nneething.el | 2 |
8 files changed, 53 insertions, 21 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index f661f4d2427..395d4b63284 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,7 +1,22 @@ | |||
| 1 | 2002-03-05 ShengHuo ZHU <zsh@cs.rochester.edu> | 1 | 2002-03-21 ShengHuo ZHU <zsh@cs.rochester.edu> |
| 2 | |||
| 3 | * mail-source.el (make-source-make-complex-temp-name): Use | ||
| 4 | make-temp-file. | ||
| 5 | |||
| 6 | * mm-util.el (mm-make-temp-file): New function. | ||
| 7 | * nneething.el (nneething-file-name): Use it. | ||
| 8 | * mm-decode.el (mm-display-external, mm-create-image-xemacs): Ditto. | ||
| 9 | * gnus-uu.el (gnus-uu-decode-binhex, gnus-uu-decode-binhex-view) | ||
| 10 | (gnus-uu-digest-mail-forward, gnus-uu-initialize): Ditto. | ||
| 11 | * gnus-start.el (gnus-slave-save-newsrc): Ditto. | ||
| 12 | |||
| 13 | * message.el (message-mode): If buffer-file-name, don't set auto | ||
| 14 | save file name. | ||
| 15 | Trivial change from Geoff Greene <ggreene@wpi.edu> | ||
| 16 | |||
| 17 | 2002-03-05 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 2 | 18 | ||
| 3 | * qp.el (quoted-printable-decode-region): Doc addition. | 19 | * qp.el (quoted-printable-decode-region): Doc addition. |
| 4 | From: Eli Zaretskii <eliz@is.elta.co.il> | ||
| 5 | 20 | ||
| 6 | 2002-02-21 ShengHuo ZHU <zsh@cs.rochester.edu> | 21 | 2002-02-21 ShengHuo ZHU <zsh@cs.rochester.edu> |
| 7 | 22 | ||
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 69ff17b4d7f..0ecdc7d912b 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -2500,7 +2500,7 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2500 | (save-excursion | 2500 | (save-excursion |
| 2501 | (set-buffer gnus-dribble-buffer) | 2501 | (set-buffer gnus-dribble-buffer) |
| 2502 | (let ((slave-name | 2502 | (let ((slave-name |
| 2503 | (make-temp-name (concat gnus-current-startup-file "-slave-"))) | 2503 | (mm-make-temp-file (concat gnus-current-startup-file "-slave-"))) |
| 2504 | (modes (ignore-errors | 2504 | (modes (ignore-errors |
| 2505 | (file-modes (concat gnus-current-startup-file ".eld"))))) | 2505 | (file-modes (concat gnus-current-startup-file ".eld"))))) |
| 2506 | (let ((coding-system-for-write gnus-ding-file-coding-system)) | 2506 | (let ((coding-system-for-write gnus-ding-file-coding-system)) |
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 4cbe01ab727..9aaf64fb596 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el | |||
| @@ -457,7 +457,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." | |||
| 457 | gnus-uu-default-dir | 457 | gnus-uu-default-dir |
| 458 | gnus-uu-default-dir)))) | 458 | gnus-uu-default-dir)))) |
| 459 | (setq gnus-uu-binhex-article-name | 459 | (setq gnus-uu-binhex-article-name |
| 460 | (make-temp-name (concat gnus-uu-work-dir "binhex"))) | 460 | (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) |
| 461 | (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) | 461 | (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) |
| 462 | 462 | ||
| 463 | (defun gnus-uu-decode-uu-view (&optional n) | 463 | (defun gnus-uu-decode-uu-view (&optional n) |
| @@ -510,7 +510,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." | |||
| 510 | (read-file-name "Unbinhex, view and save in dir: " | 510 | (read-file-name "Unbinhex, view and save in dir: " |
| 511 | gnus-uu-default-dir gnus-uu-default-dir))) | 511 | gnus-uu-default-dir gnus-uu-default-dir))) |
| 512 | (setq gnus-uu-binhex-article-name | 512 | (setq gnus-uu-binhex-article-name |
| 513 | (make-temp-name (concat gnus-uu-work-dir "binhex"))) | 513 | (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) |
| 514 | (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | 514 | (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) |
| 515 | (gnus-uu-decode-binhex n file))) | 515 | (gnus-uu-decode-binhex n file))) |
| 516 | 516 | ||
| @@ -521,7 +521,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." | |||
| 521 | "Digests and forwards all articles in this series." | 521 | "Digests and forwards all articles in this series." |
| 522 | (interactive "P") | 522 | (interactive "P") |
| 523 | (let ((gnus-uu-save-in-digest t) | 523 | (let ((gnus-uu-save-in-digest t) |
| 524 | (file (make-temp-name (nnheader-concat gnus-uu-tmp-dir "forward"))) | 524 | (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-dir "forward"))) |
| 525 | (message-forward-as-mime message-forward-as-mime) | 525 | (message-forward-as-mime message-forward-as-mime) |
| 526 | (mail-parse-charset gnus-newsgroup-charset) | 526 | (mail-parse-charset gnus-newsgroup-charset) |
| 527 | (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) | 527 | (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
| @@ -1779,8 +1779,7 @@ Gnus might fail to display all of it.") | |||
| 1779 | gnus-uu-tmp-dir))) | 1779 | gnus-uu-tmp-dir))) |
| 1780 | 1780 | ||
| 1781 | (setq gnus-uu-work-dir | 1781 | (setq gnus-uu-work-dir |
| 1782 | (make-temp-name (concat gnus-uu-tmp-dir "gnus"))) | 1782 | (mm-make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir)) |
| 1783 | (gnus-make-directory gnus-uu-work-dir) | ||
| 1784 | (set-file-modes gnus-uu-work-dir 448) | 1783 | (set-file-modes gnus-uu-work-dir 448) |
| 1785 | (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir)) | 1784 | (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir)) |
| 1786 | (push (cons gnus-newsgroup-name gnus-uu-work-dir) | 1785 | (push (cons gnus-newsgroup-name gnus-uu-work-dir) |
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 959ce9327b3..ad0f5fc23d7 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el | |||
| @@ -450,13 +450,16 @@ Return the number of files that were found." | |||
| 450 | (error "Cannot get new mail")) | 450 | (error "Cannot get new mail")) |
| 451 | 0)))))))) | 451 | 0)))))))) |
| 452 | 452 | ||
| 453 | (defun mail-source-make-complex-temp-name (prefix) | 453 | (eval-and-compile |
| 454 | (let ((newname (make-temp-name prefix)) | 454 | (if (fboundp 'make-temp-file) |
| 455 | (newprefix prefix)) | 455 | (defalias 'mail-source-make-complex-temp-name 'make-temp-file) |
| 456 | (while (file-exists-p newname) | 456 | (defun mail-source-make-complex-temp-name (prefix) |
| 457 | (setq newprefix (concat newprefix "x")) | 457 | (let ((newname (make-temp-name prefix)) |
| 458 | (setq newname (make-temp-name newprefix))) | 458 | (newprefix prefix)) |
| 459 | newname)) | 459 | (while (file-exists-p newname) |
| 460 | (setq newprefix (concat newprefix "x")) | ||
| 461 | (setq newname (make-temp-name newprefix))) | ||
| 462 | newname)))) | ||
| 460 | 463 | ||
| 461 | (defun mail-source-callback (callback info) | 464 | (defun mail-source-callback (callback info) |
| 462 | "Call CALLBACK on the mail file, and then remove the mail file. | 465 | "Call CALLBACK on the mail file, and then remove the mail file. |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index f0401d08f42..f79633e7fd1 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -1546,7 +1546,8 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." | |||
| 1546 | (if (fboundp 'mail-abbrevs-setup) | 1546 | (if (fboundp 'mail-abbrevs-setup) |
| 1547 | (mail-abbrevs-setup) | 1547 | (mail-abbrevs-setup) |
| 1548 | (mail-aliases-setup))) | 1548 | (mail-aliases-setup))) |
| 1549 | (message-set-auto-save-file-name) | 1549 | (unless buffer-file-name |
| 1550 | (message-set-auto-save-file-name)) | ||
| 1550 | (mm-enable-multibyte) | 1551 | (mm-enable-multibyte) |
| 1551 | (make-local-variable 'indent-tabs-mode) ;Turn off tabs for indentation. | 1552 | (make-local-variable 'indent-tabs-mode) ;Turn off tabs for indentation. |
| 1552 | (setq indent-tabs-mode nil) | 1553 | (setq indent-tabs-mode nil) |
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index c603e7938d7..1a8fc6db819 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -400,7 +400,8 @@ external if displayed external." | |||
| 400 | (mm-handle-set-undisplayer handle mm))))) | 400 | (mm-handle-set-undisplayer handle mm))))) |
| 401 | ;; The function is a string to be executed. | 401 | ;; The function is a string to be executed. |
| 402 | (mm-insert-part handle) | 402 | (mm-insert-part handle) |
| 403 | (let* ((dir (make-temp-name (expand-file-name "emm." mm-tmp-directory))) | 403 | (let* ((dir (mm-make-temp-file |
| 404 | (expand-file-name "emm." mm-tmp-directory) 'dir)) | ||
| 404 | (filename (mail-content-type-get | 405 | (filename (mail-content-type-get |
| 405 | (mm-handle-disposition handle) 'filename)) | 406 | (mm-handle-disposition handle) 'filename)) |
| 406 | (mime-info (mailcap-mime-info | 407 | (mime-info (mailcap-mime-info |
| @@ -410,12 +411,11 @@ external if displayed external." | |||
| 410 | (copiousoutput (assoc "copiousoutput" mime-info)) | 411 | (copiousoutput (assoc "copiousoutput" mime-info)) |
| 411 | file buffer) | 412 | file buffer) |
| 412 | ;; We create a private sub-directory where we store our files. | 413 | ;; We create a private sub-directory where we store our files. |
| 413 | (make-directory dir) | ||
| 414 | (set-file-modes dir 448) | 414 | (set-file-modes dir 448) |
| 415 | (if filename | 415 | (if filename |
| 416 | (setq file (expand-file-name (file-name-nondirectory filename) | 416 | (setq file (expand-file-name (file-name-nondirectory filename) |
| 417 | dir)) | 417 | dir)) |
| 418 | (setq file (make-temp-name (expand-file-name "mm." dir)))) | 418 | (setq file (mm-make-temp-file (expand-file-name "mm." dir)))) |
| 419 | (let ((coding-system-for-write mm-binary-coding-system)) | 419 | (let ((coding-system-for-write mm-binary-coding-system)) |
| 420 | (write-region (point-min) (point-max) file nil 'nomesg)) | 420 | (write-region (point-min) (point-max) file nil 'nomesg)) |
| 421 | (message "Viewing with %s" method) | 421 | (message "Viewing with %s" method) |
| @@ -799,7 +799,7 @@ external if displayed external." | |||
| 799 | ;; (without a ton of work) is to write them | 799 | ;; (without a ton of work) is to write them |
| 800 | ;; out to a file, and then create a file | 800 | ;; out to a file, and then create a file |
| 801 | ;; specifier. | 801 | ;; specifier. |
| 802 | (let ((file (make-temp-name | 802 | (let ((file (mm-make-temp-file |
| 803 | (expand-file-name "emm.xbm" | 803 | (expand-file-name "emm.xbm" |
| 804 | mm-tmp-directory)))) | 804 | mm-tmp-directory)))) |
| 805 | (unwind-protect | 805 | (unwind-protect |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index bbc16c04879..e540558e75e 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -723,6 +723,20 @@ If INHIBIT is non-nil, inhibit mm-inhibit-file-name-handlers." | |||
| 723 | (push dir result)) | 723 | (push dir result)) |
| 724 | (push path result)))) | 724 | (push path result)))) |
| 725 | 725 | ||
| 726 | ;; It is not a MIME function, but some MIME functions use it. | ||
| 727 | (defalias 'mm-make-temp-file | ||
| 728 | (if (fboundp 'make-temp-file) | ||
| 729 | 'make-temp-file | ||
| 730 | (lambda (prefix &optional dir-flag) | ||
| 731 | (let ((file (expand-file-name | ||
| 732 | (make-temp-name prefix) | ||
| 733 | (if (fboundp 'temp-directory) | ||
| 734 | (temp-directory) | ||
| 735 | temporary-file-directory)))) | ||
| 736 | (if dir-flag | ||
| 737 | (make-directory file)) | ||
| 738 | file)))) | ||
| 739 | |||
| 726 | (provide 'mm-util) | 740 | (provide 'mm-util) |
| 727 | 741 | ||
| 728 | ;;; mm-util.el ends here | 742 | ;;; mm-util.el ends here |
diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el index a9c3bb62e4a..70c5fcea2c0 100644 --- a/lisp/gnus/nneething.el +++ b/lisp/gnus/nneething.el | |||
| @@ -365,7 +365,7 @@ included.") | |||
| 365 | (if (numberp article) | 365 | (if (numberp article) |
| 366 | (if (setq fname (cadr (assq article nneething-map))) | 366 | (if (setq fname (cadr (assq article nneething-map))) |
| 367 | (expand-file-name fname dir) | 367 | (expand-file-name fname dir) |
| 368 | (make-temp-name (expand-file-name "nneething" dir))) | 368 | (mm-make-temp-file (expand-file-name "nneething" dir))) |
| 369 | (expand-file-name article dir)))) | 369 | (expand-file-name article dir)))) |
| 370 | 370 | ||
| 371 | (provide 'nneething) | 371 | (provide 'nneething) |