changeset 111223:0cd3fc7f7dba

Remove duplicate Lisp definition of temporary-file-directory, from filelock.c. * lisp/files.el (temporary-file-directory): Remove (already defined in C). * lisp/cus-start.el: Add temporary-file-directory.
author Glenn Morris <rgm@gnu.org>
date Thu, 28 Oct 2010 23:51:36 -0700
parents cdad894f9ed0
children b9e560ce3ab6
files lisp/ChangeLog lisp/cus-start.el lisp/files.el
diffstat 3 files changed, 32 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Oct 28 20:29:29 2010 -0700
+++ b/lisp/ChangeLog	Thu Oct 28 23:51:36 2010 -0700
@@ -1,5 +1,8 @@
 2010-10-29  Glenn Morris  <rgm@gnu.org>
 
+	* files.el (temporary-file-directory): Remove (already defined in C).
+	* cus-start.el: Add temporary-file-directory.
+
 	* abbrev.el (abbrev-mode):
 	* composite.el (auto-composition-mode):
 	* menu-bar.el (menu-bar-mode):
--- a/lisp/cus-start.el	Thu Oct 28 20:29:29 2010 -0700
+++ b/lisp/cus-start.el	Thu Oct 28 23:51:36 2010 -0700
@@ -174,6 +174,35 @@
              ;; fileio.c
              (delete-by-moving-to-trash auto-save boolean "23.1")
 	     (auto-save-visited-file-name auto-save boolean)
+	     ;; filelock.c
+	     (temporary-file-directory
+	      ;; Darwin section added 24.1, does not seem worth :version bump.
+	      files directory nil
+	      (file-name-as-directory
+	       ;; FIXME ? Should there be Ftemporary_file_directory to do this
+	       ;; more robustly (cf set_local_socket in emacsclient.c).
+	       ;; It could be used elsewhere, eg Fcall_process_region,
+	       ;; server-socket-dir.  See bug#7135.
+	       (cond ((memq system-type '(ms-dos windows-nt))
+		      (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP")
+			  "c:/temp"))
+		     ((eq system-type 'darwin)
+		      (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
+			  ;; See bug#7135.
+			  (let ((tmp (ignore-errors
+				       (shell-command-to-string
+					"getconf DARWIN_USER_TEMP_DIR"))))
+			    (and (stringp tmp)
+				 (setq tmp (replace-regexp-in-string
+					    "\n\\'" "" tmp))
+				 ;; Handles "getconf: Unrecognized variable..."
+				 (file-directory-p tmp)
+				 tmp))
+			  "/tmp"))
+		     (t
+		      (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
+			  "/tmp"))))
+	      :initialize custom-initialize-delay)
 	     ;; fns.c
 	     (use-dialog-box menu boolean "21.1")
 	     (use-file-dialog menu boolean "22.1")
--- a/lisp/files.el	Thu Oct 28 20:29:29 2010 -0700
+++ b/lisp/files.el	Thu Oct 28 23:51:36 2010 -0700
@@ -188,32 +188,6 @@
   "Non-nil if visited file was read-only when visited.")
 (make-variable-buffer-local 'buffer-file-read-only)
 
-(defcustom temporary-file-directory
-  (file-name-as-directory
-   ;; FIXME ? Should there be Ftemporary_file_directory to do the
-   ;; following more robustly (cf set_local_socket in emacsclient.c).
-   ;; It could be used elsewhere, eg Fcall_process_region, server-socket-dir.
-   ;; See bug#7135.
-   (cond ((memq system-type '(ms-dos windows-nt))
-	  (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp"))
-	 ((eq system-type 'darwin)
-	  (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
-	      (let ((tmp (ignore-errors (shell-command-to-string ; bug#7135
-					 "getconf DARWIN_USER_TEMP_DIR"))))
-		(and (stringp tmp)
-		     (setq tmp (replace-regexp-in-string "\n\\'" "" tmp))
-		     ;; This handles "getconf: Unrecognized variable..."
-		     (file-directory-p tmp)
-		     tmp))
-	      "/tmp"))
-	 (t
-	  (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))
-  "The directory for writing temporary files."
-  :group 'files
-  ;; Darwin section added 24.1, does not seem worth :version bump.
-  :initialize 'custom-initialize-delay
-  :type 'directory)
-
 (defcustom small-temporary-file-directory
   (if (eq system-type 'ms-dos) (getenv "TMPDIR"))
   "The directory for writing small temporary files.
@@ -6470,5 +6444,4 @@
 (define-key ctl-x-5-map "r" 'find-file-read-only-other-frame)
 (define-key ctl-x-5-map "\C-o" 'display-buffer-other-frame)
 
-;; arch-tag: bc68d3ea-19ca-468b-aac6-3a4a7766101f
 ;;; files.el ends here