diff options
| author | Glenn Morris | 2010-09-30 20:57:26 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-09-30 20:57:26 -0700 |
| commit | 1ef075bb27f5fa06dd668a5e9fac26029b5429bc (patch) | |
| tree | 18f51c6546baf8eee040f0594eca31aae1c4d78c | |
| parent | a16f5f64c766b006d52d6decfef8ac47b77580b5 (diff) | |
| download | emacs-1ef075bb27f5fa06dd668a5e9fac26029b5429bc.tar.gz emacs-1ef075bb27f5fa06dd668a5e9fac26029b5429bc.zip | |
Tweak temporary-file-directory on darwin systems.
* lisp/files.el (temporary-file-directory): On darwin, also try
DARWIN_USER_TEMP_DIR (see discussion in bug#7135).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 901a5fb53a3..b1092c28cab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-10-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * files.el (temporary-file-directory): On darwin, also try | ||
| 4 | DARWIN_USER_TEMP_DIR (see discussion in bug#7135). | ||
| 5 | |||
| 1 | 2010-10-01 Juanma Barranquero <lekktu@gmail.com> | 6 | 2010-10-01 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * server.el (server-start): Revert part of 2010-09-30T02:53:26Z!lekktu@gmail.com. | 8 | * server.el (server-start): Revert part of 2010-09-30T02:53:26Z!lekktu@gmail.com. |
diff --git a/lisp/files.el b/lisp/files.el index 40627f690f8..92574283dd7 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -190,12 +190,27 @@ If the buffer is visiting a new file, the value is nil.") | |||
| 190 | 190 | ||
| 191 | (defcustom temporary-file-directory | 191 | (defcustom temporary-file-directory |
| 192 | (file-name-as-directory | 192 | (file-name-as-directory |
| 193 | ;; FIXME ? Should there be Ftemporary_file_directory to do the | ||
| 194 | ;; following more robustly (cf set_local_socket in emacsclient.c). | ||
| 195 | ;; It could be used elsewhere, eg Fcall_process_region, server-socket-dir. | ||
| 196 | ;; See bug#7135. | ||
| 193 | (cond ((memq system-type '(ms-dos windows-nt)) | 197 | (cond ((memq system-type '(ms-dos windows-nt)) |
| 194 | (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp")) | 198 | (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp")) |
| 199 | ((eq system-type 'darwin) | ||
| 200 | (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") | ||
| 201 | (let ((tmp (ignore-errors (shell-command-to-string ; bug#7135 | ||
| 202 | "getconf DARWIN_USER_TEMP_DIR")))) | ||
| 203 | (and (stringp tmp) | ||
| 204 | (setq tmp (replace-regexp-in-string "\n\\'" "" tmp)) | ||
| 205 | ;; This handles "getconf: Unrecognized variable..." | ||
| 206 | (file-directory-p tmp) | ||
| 207 | tmp)) | ||
| 208 | "/tmp")) | ||
| 195 | (t | 209 | (t |
| 196 | (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")))) | 210 | (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")))) |
| 197 | "The directory for writing temporary files." | 211 | "The directory for writing temporary files." |
| 198 | :group 'files | 212 | :group 'files |
| 213 | ;; Darwin section added 24.1, does not seem worth :version bump. | ||
| 199 | :initialize 'custom-initialize-delay | 214 | :initialize 'custom-initialize-delay |
| 200 | :type 'directory) | 215 | :type 'directory) |
| 201 | 216 | ||