diff options
| author | Chong Yidong | 2009-02-07 21:56:47 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-02-07 21:56:47 +0000 |
| commit | fa8c4a38fd2d23d330a01ec56c85020e720f0732 (patch) | |
| tree | 9f88b307948e9be9f49ec19db20c4c4b79d5b02d | |
| parent | 74fe63d94fd9a0d90defcb7d7bdebc466df9962c (diff) | |
| download | emacs-fa8c4a38fd2d23d330a01ec56c85020e720f0732.tar.gz emacs-fa8c4a38fd2d23d330a01ec56c85020e720f0732.zip | |
(ps-run-tmp-dir): Doc fix.
(ps-run-make-tmp-filename): Use temporary-file-directory.
| -rw-r--r-- | lisp/progmodes/ps-mode.el | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el index 0c60b05d1d1..160907d39b5 100644 --- a/lisp/progmodes/ps-mode.el +++ b/lisp/progmodes/ps-mode.el | |||
| @@ -181,12 +181,7 @@ You won't need to set this option for Ghostscript." | |||
| 181 | 181 | ||
| 182 | (defcustom ps-run-tmp-dir nil | 182 | (defcustom ps-run-tmp-dir nil |
| 183 | "*Name of directory to place temporary file. | 183 | "*Name of directory to place temporary file. |
| 184 | 184 | If nil, use `temporary-file-directory'." | |
| 185 | If nil, the following are tried in turn, until success: | ||
| 186 | 1. \"$TEMP\" | ||
| 187 | 2. \"$TMP\" | ||
| 188 | 3. \"$HOME/tmp\" | ||
| 189 | 4. \"/tmp\"" | ||
| 190 | :group 'PostScript-interaction | 185 | :group 'PostScript-interaction |
| 191 | :type '(choice (const nil) directory)) | 186 | :type '(choice (const nil) directory)) |
| 192 | 187 | ||
| @@ -1124,24 +1119,10 @@ grestore | |||
| 1124 | 1119 | ||
| 1125 | (defun ps-run-make-tmp-filename () | 1120 | (defun ps-run-make-tmp-filename () |
| 1126 | (unless ps-mode-tmp-file | 1121 | (unless ps-mode-tmp-file |
| 1127 | (cond (ps-run-tmp-dir) | ||
| 1128 | ((setq ps-run-tmp-dir (getenv "TEMP"))) | ||
| 1129 | ((setq ps-run-tmp-dir (getenv "TMP"))) | ||
| 1130 | ((setq ps-run-tmp-dir (getenv "HOME")) | ||
| 1131 | (setq | ||
| 1132 | ps-run-tmp-dir | ||
| 1133 | (concat (file-name-as-directory ps-run-tmp-dir) "tmp")) | ||
| 1134 | (unless (file-directory-p ps-run-tmp-dir) | ||
| 1135 | (setq ps-run-tmp-dir nil)))) | ||
| 1136 | (unless ps-run-tmp-dir | ||
| 1137 | (setq ps-run-tmp-dir "/tmp")) | ||
| 1138 | (setq ps-mode-tmp-file | 1122 | (setq ps-mode-tmp-file |
| 1139 | (make-temp-file | 1123 | (let ((temporary-file-directory (or ps-run-tmp-dir |
| 1140 | (concat | 1124 | temporary-file-directory))) |
| 1141 | (if ps-run-tmp-dir | 1125 | (make-temp-file "ps-run-")))) |
| 1142 | (file-name-as-directory ps-run-tmp-dir) | ||
| 1143 | "") | ||
| 1144 | "ps-run-")))) | ||
| 1145 | ps-mode-tmp-file) | 1126 | ps-mode-tmp-file) |
| 1146 | 1127 | ||
| 1147 | ;; Remove temporary file | 1128 | ;; Remove temporary file |