emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/progmodes ps-mode.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp/progmodes ps-mode.el
Date: Sat, 07 Feb 2009 21:56:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/02/07 21:56:48

Modified files:
        lisp/progmodes : ps-mode.el 

Log message:
        (ps-run-tmp-dir): Doc fix.
        (ps-run-make-tmp-filename): Use temporary-file-directory.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/ps-mode.el?cvsroot=emacs&r1=1.31&r2=1.32

Patches:
Index: ps-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/ps-mode.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- ps-mode.el  5 Jan 2009 03:23:48 -0000       1.31
+++ ps-mode.el  7 Feb 2009 21:56:47 -0000       1.32
@@ -181,12 +181,7 @@
 
 (defcustom ps-run-tmp-dir nil
   "*Name of directory to place temporary file.
-
-If nil, the following are tried in turn, until success:
-  1. \"$TEMP\"
-  2. \"$TMP\"
-  3. \"$HOME/tmp\"
-  4. \"/tmp\""
+If nil, use `temporary-file-directory'."
   :group 'PostScript-interaction
   :type '(choice (const nil) directory))
 
@@ -1124,24 +1119,10 @@
 
 (defun ps-run-make-tmp-filename ()
   (unless ps-mode-tmp-file
-    (cond (ps-run-tmp-dir)
-         ((setq ps-run-tmp-dir (getenv "TEMP")))
-         ((setq ps-run-tmp-dir (getenv "TMP")))
-         ((setq ps-run-tmp-dir (getenv "HOME"))
-          (setq
-           ps-run-tmp-dir
-           (concat (file-name-as-directory ps-run-tmp-dir) "tmp"))
-          (unless (file-directory-p ps-run-tmp-dir)
-            (setq ps-run-tmp-dir nil))))
-    (unless ps-run-tmp-dir
-      (setq ps-run-tmp-dir "/tmp"))
     (setq ps-mode-tmp-file
-         (make-temp-file
-          (concat
-           (if ps-run-tmp-dir
-               (file-name-as-directory ps-run-tmp-dir)
-             "")
-           "ps-run-"))))
+         (let ((temporary-file-directory (or ps-run-tmp-dir
+                                             temporary-file-directory)))
+           (make-temp-file "ps-run-"))))
   ps-mode-tmp-file)
 
 ;; Remove temporary file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]