[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2211: server-socket-dir and make-temp-file
From: |
Stefan Monnier |
Subject: |
bug#2211: server-socket-dir and make-temp-file |
Date: |
Thu, 05 Feb 2009 14:51:02 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
> server-socket-dir is by default a directory in /tmp. With CVS emacs
> it also takes the TMPDIR environment variable into account.
> Shouldn't this variable be initialized using make-temp-file so that
> it obeys any customization of temporary-file-directory?
No, because emacsclient needs to access server-socket-dir but doesn't
read the .emacs so can't adapt to changes in temporary-file-directory
(it does pay attention to $TMPDIR, on the other hand).
> Actually, I ran the following command in the emacs directory
> $ grep "\"/tmp\"" lisp/*el lisp/*/*el
> Browsing through the matches, it seems to me that
> pmail-mime-attachment-dirs-alist and url-temporary-directory
> should be updated, too.
You're probably right on these ones.
> A related issue: I do not quite understand a piece of code like
> (make-temp-file
> (concat (file-name-as-directory
> (or (getenv "TMPDIR") "/tmp"))
> "artist-stdin."))
> used in the function artist-system. If the PREFIX arg of
> make-temp-file is an absolute directory as in the example above,
> make-temp-file will ignore any user customization of
> temporary-file-directory. The function ps-run-make-tmp-filename
> behaves similarly.
At first, I was going to say that
(concat (file-name-as-directory
(or (getenv "TMPDIR") "/tmp"))
"artist-stdin.")
should be replaced by
(expand-file-name "artist-stdin." (or (getenv "TMPDIR") "/tmp"))
but indeed, it's better to just skip it all and let `make-temp-file' use
temporary-file-directory.
Stefan