all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch for user-emacs-directory
@ 2007-05-27 21:24 Tom Tromey
  2007-05-27 22:47 ` Leo
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Tom Tromey @ 2007-05-27 21:24 UTC (permalink / raw)
  To: Emacs Hackers

This patch changes Emacs to use user-emacs-directory rather than
"~/.emacs.d".  I spot-tested various instances of the change but did
not try to test every single one.  The patch is essentially
mechanical.

A few notes:

* I didn't try to update the docs.
* I chose subr.el for the new definition because it had to be early
  enough in the bootstrap for custom.el and other files to reference.
* I used a defconst and not a defcustom because the use of .emacs.d
  in some places would seem to make it difficult to meaningfully
  configure this.
* I didn't use convert-standard-filename because that is not available
  when subr.el is loaded.
* The ERC change needs to be redone if ERC needs to continue working
  on Emacs 21 and 22.  Perhaps this needs to be done upstream?  I'm
  happy to handle that, just let me know.

Tom

etc/ChangeLog
2007-05-27  Tom Tromey  <tromey@redhat.com>

	* NEWS: Mention user-emacs-directory.

lisp/ChangeLog
2007-05-27  Tom Tromey  <tromey@redhat.com>

	* subr.el (user-emacs-directory): New defconst.
	* cmuscheme.el (scheme-start-file): Use user-emacs-directory.
	* shell.el (shell): Use user-emacs-directory.
	* completion.el (save-completions-file-name): Use
	user-emacs-directory.
	* custom.el (custom-theme-directory): Use user-emacs-directory.
	* term/x-win.el (emacs-session-filename): Use
	user-emacs-directory.
	* filesets.el (filesets-menu-cache-file): Use
	user-emacs-directory.
	* thumbs.el (thumbs-thumbsdir): Use user-emacs-directory.
	* server.el (server-auth-dir): Use user-emacs-directory.
	* image-dired.el (image-dired-dir): Use user-emacs-directory.
	(image-dired-db-file): Likewise.
	(image-dired-temp-image-file): Likewise.
	(image-dired-gallery-dir): Likewise.
	(image-dired-temp-rotate-image-file): Likewise.
	* play/gamegrid.el (gamegrid-user-score-file-directory): Use
	user-emacs-directory.
	* savehist.el (savehist-file): Use user-emacs-directory.
	* tutorial.el (tutorial--saved-dir): Use user-emacs-directory.
	* startup.el (auto-save-list-file-prefix): Use
	user-emacs-directory.

lisp/erc/ChangeLog
2007-05-27  Tom Tromey  <tromey@redhat.com>

	* erc.el (erc-startup-file-list): Use user-emacs-directory.

Index: lisp/url/ChangeLog
2007-05-27  Tom Tromey  <tromey@redhat.com>

	* url.el (url-configuration-directory): Use user-emacs-directory.


Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1480
diff -u -r1.1480 NEWS
--- etc/NEWS 25 May 2007 16:58:18 -0000 1.1480
+++ etc/NEWS 27 May 2007 21:38:45 -0000
@@ -47,6 +47,10 @@
 \f
 * Lisp Changes in Emacs 23.1
 
+*** New variable `user-emacs-directory'.
+
+Use this instead of "~/.emacs.d".
+
 \f
 * New Packages for Lisp Programming in Emacs 23.1
 
Index: lisp/cmuscheme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/cmuscheme.el,v
retrieving revision 1.46
diff -u -r1.46 cmuscheme.el
--- lisp/cmuscheme.el 21 Jan 2007 03:53:12 -0000 1.46
+++ lisp/cmuscheme.el 27 May 2007 21:38:46 -0000
@@ -271,7 +271,7 @@
 order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
 	 (start-file (concat "~/.emacs_" progname))
-	 (alt-start-file (concat "~/.emacs.d/init_" progname ".scm")))
+	 (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
Index: lisp/completion.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/completion.el,v
retrieving revision 1.60
diff -u -r1.60 completion.el
--- lisp/completion.el 21 Jan 2007 03:53:12 -0000 1.60
+++ lisp/completion.el 27 May 2007 21:38:47 -0000
@@ -301,9 +301,8 @@
   (let ((olddef (convert-standard-filename "~/.completions")))
     (cond
      ((file-readable-p olddef) olddef)
-     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
-      (convert-standard-filename
-       (expand-file-name "completions" "~/.emacs.d/")))
+     ((file-directory-p user-emacs-directory)
+      (expand-file-name "completions" user-emacs-directory))
      (t olddef)))
   "The filename to save completions to."
   :type 'file
Index: lisp/custom.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/custom.el,v
retrieving revision 1.133
diff -u -r1.133 custom.el
--- lisp/custom.el 25 Apr 2007 04:44:28 -0000 1.133
+++ lisp/custom.el 27 May 2007 21:38:47 -0000
@@ -1009,10 +1009,7 @@
 ;;; Loading themes.
 
 (defcustom custom-theme-directory
-  (if (eq system-type 'ms-dos)
-	 ;; MS-DOS cannot have initial dot.
-	 "~/_emacs.d/"
-      "~/.emacs.d/")
+  user-emacs-directory
   "Directory in which Custom theme files should be written.
 `load-theme' searches this directory in addition to load-path.
 The command `customize-create-theme' writes the files it produces
Index: lisp/filesets.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/filesets.el,v
retrieving revision 1.32
diff -u -r1.32 filesets.el
--- lisp/filesets.el 21 Jan 2007 03:53:11 -0000 1.32
+++ lisp/filesets.el 27 May 2007 21:38:48 -0000
@@ -354,7 +354,7 @@
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
-      "~/.emacs.d/filesets-cache.el")
+    (concat user-emacs-directory "filesets-cache.el"))
   "*File to be used for saving the filesets menu between sessions.
 Set this to \"\", to disable caching of menus.
 Don't forget to check out `filesets-menu-ensure-use-cached'."
Index: lisp/image-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-dired.el,v
retrieving revision 1.3
diff -u -r1.3 image-dired.el
--- lisp/image-dired.el 28 Apr 2007 04:12:58 -0000 1.3
+++ lisp/image-dired.el 27 May 2007 21:38:50 -0000
@@ -166,7 +166,7 @@
   :prefix "image-dired-"
   :group 'multimedia)
 
-(defcustom image-dired-dir "~/.emacs.d/image-dired/"
+(defcustom image-dired-dir (concat user-emacs-directory "image-dired/")
   "Directory where thumbnail images are stored."
   :type 'string
   :group 'image-dired)
@@ -187,17 +187,20 @@
                  (const :tag "Per-directory" per-directory))
   :group 'image-dired)
 
-(defcustom image-dired-db-file "~/.emacs.d/image-dired/.image-dired_db"
+(defcustom image-dired-db-file
+  (concat user-emacs-directory "image-dired/.image-dired_db")
   "Database file where file names and their associated tags are stored."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-temp-image-file "~/.emacs.d/image-dired/.image-dired_temp"
+(defcustom image-dired-temp-image-file
+  (concat user-emacs-directory "image-dired/.image-dired_temp")
   "Name of temporary image file used by various commands."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-gallery-dir "~/.emacs.d/image-dired/.image-dired_gallery"
+(defcustom image-dired-gallery-dir
+  (concat user-emacs-directory "image-dired/.image-dired_gallery")
   "Directory to store generated gallery html pages.
 This path needs to be \"shared\" to the public so that it can access
 the index.html page that image-dired creates."
@@ -342,7 +345,7 @@
   :group 'image-dired)
 
 (defcustom image-dired-temp-rotate-image-file
-  "~/.emacs.d/image-dired/.image-dired_rotate_temp"
+  (concat user-emacs-directory "image-dired/.image-dired_rotate_temp")
   "Temporary file for rotate operations."
   :type 'string
   :group 'image-dired)
Index: lisp/savehist.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/savehist.el,v
retrieving revision 1.19
diff -u -r1.19 savehist.el
--- lisp/savehist.el 21 Jan 2007 03:53:11 -0000 1.19
+++ lisp/savehist.el 27 May 2007 21:38:50 -0000
@@ -101,8 +101,8 @@
   (cond
    ;; Backward compatibility with previous versions of savehist.
    ((file-exists-p "~/.emacs-history") "~/.emacs-history")
-   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
-    "~/.emacs.d/history")
+   ((and (not (featurep 'xemacs)) (file-directory-p user-emacs-directory))
+    (concat user-emacs-directory "history"))
    ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
     "~/.xemacs/history")
    ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
Index: lisp/server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.127
diff -u -r1.127 server.el
--- lisp/server.el 21 Mar 2007 12:02:32 -0000 1.127
+++ lisp/server.el 27 May 2007 21:38:50 -0000
@@ -105,7 +105,7 @@
   :version "22.1")
 (put 'server-host 'risky-local-variable t)
 
-(defcustom server-auth-dir "~/.emacs.d/server/"
+(defcustom server-auth-dir (concat user-emacs-directory "server/")
   "Directory for server authentication files."
   :group 'server
   :type 'directory
Index: lisp/shell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/shell.el,v
retrieving revision 1.149
diff -u -r1.149 shell.el
--- lisp/shell.el 4 Mar 2007 17:47:19 -0000 1.149
+++ lisp/shell.el 27 May 2007 21:38:50 -0000
@@ -557,7 +557,7 @@
 	   (startfile (concat "~/.emacs_" name))
 	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
       (unless (file-exists-p startfile)
-	(setq startfile (concat "~/.emacs.d/init_" name ".sh")))
+	(setq startfile (concat user-emacs-directory "init_" name ".sh")))
       (apply 'make-comint-in-buffer "shell" buffer prog
 	     (if (file-exists-p startfile) startfile)
 	     (if (and xargs-name (boundp xargs-name))
Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.437
diff -u -r1.437 startup.el
--- lisp/startup.el 11 May 2007 04:44:30 -0000 1.437
+++ lisp/startup.el 27 May 2007 21:38:51 -0000
@@ -263,9 +263,9 @@
 (defcustom auto-save-list-file-prefix
   (cond ((eq system-type 'ms-dos)
 	 ;; MS-DOS cannot have initial dot, and allows only 8.3 names
-	 "~/_emacs.d/auto-save.list/_s")
+	 (concat user-emacs-directory "auto-save.list/_s"))
 	(t
-	 "~/.emacs.d/auto-save-list/.saves-"))
+	 (concat user-emacs-directory "auto-save-list/.saves-")))
   "Prefix for generating `auto-save-list-file-name'.
 This is used after reading your `.emacs' file to initialize
 `auto-save-list-file-name', by appending Emacs's pid and the system name,
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.554
diff -u -r1.554 subr.el
--- lisp/subr.el 22 Apr 2007 16:56:19 -0000 1.554
+++ lisp/subr.el 27 May 2007 21:38:52 -0000
@@ -2041,6 +2041,15 @@
 (put 'cl-assertion-failed 'error-conditions '(error))
 (put 'cl-assertion-failed 'error-message "Assertion failed")
 
+(defconst user-emacs-directory
+  (if (eq system-type 'ms-dos)
+      ;; MS-DOS cannot have initial dot.
+      "~/_emacs.d/"
+    "~/.emacs.d/")
+  "Directory beneath which additional per-user Emacs-specific files are placed.
+Various programs in Emacs store information in this directory.
+Note that this should end with a directory separator.")
+
 \f
 ;;;; Misc. useful functions.
 
Index: lisp/thumbs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/thumbs.el,v
retrieving revision 1.33
diff -u -r1.33 thumbs.el
--- lisp/thumbs.el 22 Apr 2007 13:44:43 -0000 1.33
+++ lisp/thumbs.el 27 May 2007 21:38:52 -0000
@@ -67,7 +67,7 @@
   :version "22.1"
   :group 'multimedia)
 
-(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs"
+(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
   "*Directory to store thumbnails."
   :type 'directory
   :group 'thumbs)
Index: lisp/tutorial.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tutorial.el,v
retrieving revision 1.16
diff -u -r1.16 tutorial.el
--- lisp/tutorial.el 16 May 2007 13:19:02 -0000 1.16
+++ lisp/tutorial.el 27 May 2007 21:38:53 -0000
@@ -611,8 +611,7 @@
 
 (defun tutorial--saved-dir ()
   "Directory to which tutorials are saved."
-  (expand-file-name "tutorial"
-		    (if (eq system-type 'ms-dos) "~/_emacs.d/" "~/.emacs.d/")))
+  (expand-file-name "tutorial" user-emacs-directory))
 
 (defun tutorial--saved-file ()
   "File name in which to save tutorials."
Index: lisp/erc/erc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/erc/erc.el,v
retrieving revision 1.26
diff -u -r1.26 erc.el
--- lisp/erc/erc.el 1 Apr 2007 13:36:38 -0000 1.26
+++ lisp/erc/erc.el 27 May 2007 21:38:55 -0000
@@ -836,8 +836,9 @@
 ;; Script parameters
 
 (defcustom erc-startup-file-list
-  '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc"
-    "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
+  (list (concat user-emacs-directory ".ercrc.el")
+	(concat user-emacs-directory ".ercrc")
+	"~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
   "List of files to try for a startup script.
 The first existent and readable one will get executed.
 
Index: lisp/play/gamegrid.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/play/gamegrid.el,v
retrieving revision 1.27
diff -u -r1.27 gamegrid.el
--- lisp/play/gamegrid.el 3 Mar 2007 12:15:23 -0000 1.27
+++ lisp/play/gamegrid.el 27 May 2007 21:38:55 -0000
@@ -66,7 +66,8 @@
 (defvar gamegrid-score-file-length 50
   "Number of high scores to keep")
 
-(defvar gamegrid-user-score-file-directory "~/.emacs.d/games"
+(defvar gamegrid-user-score-file-directory
+  (concat user-emacs-directory "games")
   "A directory for game scores which can't be shared.
 If Emacs was built without support for shared game scores, then this
 directory will be used.")
Index: lisp/term/x-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/x-win.el,v
retrieving revision 1.200
diff -u -r1.200 x-win.el
--- lisp/term/x-win.el 6 Mar 2007 05:50:48 -0000 1.200
+++ lisp/term/x-win.el 27 May 2007 21:38:56 -0000
@@ -263,7 +263,7 @@
 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
 a file in the home directory."
   (let ((basename (concat "session." session-id))
-	(emacs-dir "~/.emacs.d/"))
+	(emacs-dir user-emacs-directory))
     (expand-file-name (if (file-directory-p emacs-dir)
 			  (concat emacs-dir basename)
 			(concat "~/.emacs-" basename)))))
Index: lisp/url/url.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url.el,v
retrieving revision 1.27
diff -u -r1.27 url.el
--- lisp/url/url.el 21 Jan 2007 03:24:41 -0000 1.27
+++ lisp/url/url.el 27 May 2007 21:38:57 -0000
@@ -50,7 +50,8 @@
 (defvar url-configuration-directory
   (cond
    ((file-directory-p "~/.url") "~/.url")
-   ((file-directory-p "~/.emacs.d") "~/.emacs.d/url")
+   ((file-directory-p user-emacs-directory)
+    (concat user-emacs-directory "url"))
    (t "~/.url")))
 
 (defun url-do-setup ()

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-05-27 21:24 Patch for user-emacs-directory Tom Tromey
@ 2007-05-27 22:47 ` Leo
  2007-05-28 14:37 ` Richard Stallman
  2007-05-30  1:32 ` Michael Olson
  2 siblings, 0 replies; 15+ messages in thread
From: Leo @ 2007-05-27 22:47 UTC (permalink / raw)
  To: emacs-devel

----- Tom Tromey (2007-05-27) wrote:-----

> This patch changes Emacs to use user-emacs-directory rather than
> "~/.emacs.d".  I spot-tested various instances of the change but did
> not try to test every single one.  The patch is essentially
> mechanical.

Thanks. I have been looking for this for a long time ;)

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-05-27 21:24 Patch for user-emacs-directory Tom Tromey
  2007-05-27 22:47 ` Leo
@ 2007-05-28 14:37 ` Richard Stallman
  2007-06-02 21:53   ` Tom Tromey
  2007-05-30  1:32 ` Michael Olson
  2 siblings, 1 reply; 15+ messages in thread
From: Richard Stallman @ 2007-05-28 14:37 UTC (permalink / raw)
  To: Tom Tromey; +Cc: emacs-devel

    * I didn't try to update the docs.

Someone should do that before this is installed.  However, for
simplicity, the user's manual should continue to refer principally to
the directory's normal name, rather than the variable.  The manual
should mention once or twice that a variable controls the directory
name, as a side point.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-05-27 21:24 Patch for user-emacs-directory Tom Tromey
  2007-05-27 22:47 ` Leo
  2007-05-28 14:37 ` Richard Stallman
@ 2007-05-30  1:32 ` Michael Olson
  2 siblings, 0 replies; 15+ messages in thread
From: Michael Olson @ 2007-05-30  1:32 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 895 bytes --]

Tom Tromey <tromey@redhat.com> writes:

> This patch changes Emacs to use user-emacs-directory rather than
> "~/.emacs.d".  I spot-tested various instances of the change but did
> not try to test every single one.  The patch is essentially
> mechanical.
>
> [snip]
> * The ERC change needs to be redone if ERC needs to continue working
>   on Emacs 21 and 22.  Perhaps this needs to be done upstream?  I'm
>   happy to handle that, just let me know.

I've added some logic to ERC upstream to deal with this case.  Just ping
me once your patch is in Emacs 22 trunk, and I'll update erc-compat.el
in trunk appropriately.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
            Sysadmin -- Hobbies: Lisp, GP2X, HCoop    | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-05-28 14:37 ` Richard Stallman
@ 2007-06-02 21:53   ` Tom Tromey
  2007-06-03  3:09     ` Eli Zaretskii
  2007-06-03 21:27     ` Richard Stallman
  0 siblings, 2 replies; 15+ messages in thread
From: Tom Tromey @ 2007-06-02 21:53 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:

>     * I didn't try to update the docs.

rms> Someone should do that before this is installed.  However, for
rms> simplicity, the user's manual should continue to refer principally to
rms> the directory's normal name, rather than the variable.  The manual
rms> should mention once or twice that a variable controls the directory
rms> name, as a side point.

I looked through the user's manual but there didn't seem to be a very
good place to do this.  And, this isn't a variable but a constant,
since I think it doesn't make sense to let the user customize it.  So
I'm hoping you will agree that it is ok to leave it as-is.

Here's a new patch that does document the new constant in the
reference manual.  It also omits the ERC part of the patch since
Michael has that in hand.

Comments?

Tom

etc/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* NEWS: Mention user-emacs-directory.

lisp/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* subr.el (user-emacs-directory): New defconst.
	* cmuscheme.el (scheme-start-file): Use user-emacs-directory.
	* shell.el (shell): Use user-emacs-directory.
	* completion.el (save-completions-file-name): Use
	user-emacs-directory.
	* custom.el (custom-theme-directory): Use user-emacs-directory.
	* term/x-win.el (emacs-session-filename): Use
	user-emacs-directory.
	* filesets.el (filesets-menu-cache-file): Use
	user-emacs-directory.
	* thumbs.el (thumbs-thumbsdir): Use user-emacs-directory.
	* server.el (server-auth-dir): Use user-emacs-directory.
	* image-dired.el (image-dired-dir): Use user-emacs-directory.
	(image-dired-db-file): Likewise.
	(image-dired-temp-image-file): Likewise.
	(image-dired-gallery-dir): Likewise.
	(image-dired-temp-rotate-image-file): Likewise.
	* play/gamegrid.el (gamegrid-user-score-file-directory): Use
	user-emacs-directory.
	* savehist.el (savehist-file): Use user-emacs-directory.
	* tutorial.el (tutorial--saved-dir): Use user-emacs-directory.
	* startup.el (auto-save-list-file-prefix): Use
	user-emacs-directory.

lisp/url/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* url.el (url-configuration-directory): Use user-emacs-directory.

lispref/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* os.texi (Init File): Document user-emacs-directory.

Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1481
diff -u -r1.1481 NEWS
--- etc/NEWS	31 May 2007 00:52:35 -0000	1.1481
+++ etc/NEWS	2 Jun 2007 22:11:41 -0000
@@ -48,6 +48,10 @@
 \f
 * Lisp Changes in Emacs 23.1
 
+*** New variable `user-emacs-directory'.
+
+Use this instead of "~/.emacs.d".
+
 \f
 * New Packages for Lisp Programming in Emacs 23.1
 
Index: lisp/cmuscheme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/cmuscheme.el,v
retrieving revision 1.46
diff -u -r1.46 cmuscheme.el
--- lisp/cmuscheme.el	21 Jan 2007 03:53:12 -0000	1.46
+++ lisp/cmuscheme.el	2 Jun 2007 22:11:41 -0000
@@ -271,7 +271,7 @@
 order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
 	 (start-file (concat "~/.emacs_" progname))
-	 (alt-start-file (concat "~/.emacs.d/init_" progname ".scm")))
+	 (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
Index: lisp/completion.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/completion.el,v
retrieving revision 1.60
diff -u -r1.60 completion.el
--- lisp/completion.el	21 Jan 2007 03:53:12 -0000	1.60
+++ lisp/completion.el	2 Jun 2007 22:11:42 -0000
@@ -301,9 +301,8 @@
   (let ((olddef (convert-standard-filename "~/.completions")))
     (cond
      ((file-readable-p olddef) olddef)
-     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
-      (convert-standard-filename
-       (expand-file-name "completions" "~/.emacs.d/")))
+     ((file-directory-p user-emacs-directory)
+      (expand-file-name "completions" user-emacs-directory))
      (t olddef)))
   "The filename to save completions to."
   :type 'file
Index: lisp/custom.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/custom.el,v
retrieving revision 1.133
diff -u -r1.133 custom.el
--- lisp/custom.el	25 Apr 2007 04:44:28 -0000	1.133
+++ lisp/custom.el	2 Jun 2007 22:11:42 -0000
@@ -1009,10 +1009,7 @@
 ;;; Loading themes.
 
 (defcustom custom-theme-directory
-  (if (eq system-type 'ms-dos)
-	 ;; MS-DOS cannot have initial dot.
-	 "~/_emacs.d/"
-      "~/.emacs.d/")
+  user-emacs-directory
   "Directory in which Custom theme files should be written.
 `load-theme' searches this directory in addition to load-path.
 The command `customize-create-theme' writes the files it produces
Index: lisp/filesets.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/filesets.el,v
retrieving revision 1.32
diff -u -r1.32 filesets.el
--- lisp/filesets.el	21 Jan 2007 03:53:11 -0000	1.32
+++ lisp/filesets.el	2 Jun 2007 22:11:42 -0000
@@ -354,7 +354,7 @@
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
-      "~/.emacs.d/filesets-cache.el")
+    (concat user-emacs-directory "filesets-cache.el"))
   "*File to be used for saving the filesets menu between sessions.
 Set this to \"\", to disable caching of menus.
 Don't forget to check out `filesets-menu-ensure-use-cached'."
Index: lisp/image-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-dired.el,v
retrieving revision 1.3
diff -u -r1.3 image-dired.el
--- lisp/image-dired.el	28 Apr 2007 04:12:58 -0000	1.3
+++ lisp/image-dired.el	2 Jun 2007 22:11:43 -0000
@@ -166,7 +166,7 @@
   :prefix "image-dired-"
   :group 'multimedia)
 
-(defcustom image-dired-dir "~/.emacs.d/image-dired/"
+(defcustom image-dired-dir (concat user-emacs-directory "image-dired/")
   "Directory where thumbnail images are stored."
   :type 'string
   :group 'image-dired)
@@ -187,17 +187,20 @@
                  (const :tag "Per-directory" per-directory))
   :group 'image-dired)
 
-(defcustom image-dired-db-file "~/.emacs.d/image-dired/.image-dired_db"
+(defcustom image-dired-db-file
+  (concat user-emacs-directory "image-dired/.image-dired_db")
   "Database file where file names and their associated tags are stored."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-temp-image-file "~/.emacs.d/image-dired/.image-dired_temp"
+(defcustom image-dired-temp-image-file
+  (concat user-emacs-directory "image-dired/.image-dired_temp")
   "Name of temporary image file used by various commands."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-gallery-dir "~/.emacs.d/image-dired/.image-dired_gallery"
+(defcustom image-dired-gallery-dir
+  (concat user-emacs-directory "image-dired/.image-dired_gallery")
   "Directory to store generated gallery html pages.
 This path needs to be \"shared\" to the public so that it can access
 the index.html page that image-dired creates."
@@ -342,7 +345,7 @@
   :group 'image-dired)
 
 (defcustom image-dired-temp-rotate-image-file
-  "~/.emacs.d/image-dired/.image-dired_rotate_temp"
+  (concat user-emacs-directory "image-dired/.image-dired_rotate_temp")
   "Temporary file for rotate operations."
   :type 'string
   :group 'image-dired)
Index: lisp/savehist.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/savehist.el,v
retrieving revision 1.19
diff -u -r1.19 savehist.el
--- lisp/savehist.el	21 Jan 2007 03:53:11 -0000	1.19
+++ lisp/savehist.el	2 Jun 2007 22:11:43 -0000
@@ -101,8 +101,8 @@
   (cond
    ;; Backward compatibility with previous versions of savehist.
    ((file-exists-p "~/.emacs-history") "~/.emacs-history")
-   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
-    "~/.emacs.d/history")
+   ((and (not (featurep 'xemacs)) (file-directory-p user-emacs-directory))
+    (concat user-emacs-directory "history"))
    ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
     "~/.xemacs/history")
    ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
Index: lisp/server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.127
diff -u -r1.127 server.el
--- lisp/server.el	21 Mar 2007 12:02:32 -0000	1.127
+++ lisp/server.el	2 Jun 2007 22:11:43 -0000
@@ -105,7 +105,7 @@
   :version "22.1")
 (put 'server-host 'risky-local-variable t)
 
-(defcustom server-auth-dir "~/.emacs.d/server/"
+(defcustom server-auth-dir (concat user-emacs-directory "server/")
   "Directory for server authentication files."
   :group 'server
   :type 'directory
Index: lisp/shell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/shell.el,v
retrieving revision 1.149
diff -u -r1.149 shell.el
--- lisp/shell.el	4 Mar 2007 17:47:19 -0000	1.149
+++ lisp/shell.el	2 Jun 2007 22:11:43 -0000
@@ -557,7 +557,7 @@
 	   (startfile (concat "~/.emacs_" name))
 	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
       (unless (file-exists-p startfile)
-	(setq startfile (concat "~/.emacs.d/init_" name ".sh")))
+	(setq startfile (concat user-emacs-directory "init_" name ".sh")))
       (apply 'make-comint-in-buffer "shell" buffer prog
 	     (if (file-exists-p startfile) startfile)
 	     (if (and xargs-name (boundp xargs-name))
Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.437
diff -u -r1.437 startup.el
--- lisp/startup.el	11 May 2007 04:44:30 -0000	1.437
+++ lisp/startup.el	2 Jun 2007 22:11:43 -0000
@@ -263,9 +263,9 @@
 (defcustom auto-save-list-file-prefix
   (cond ((eq system-type 'ms-dos)
 	 ;; MS-DOS cannot have initial dot, and allows only 8.3 names
-	 "~/_emacs.d/auto-save.list/_s")
+	 (concat user-emacs-directory "auto-save.list/_s"))
 	(t
-	 "~/.emacs.d/auto-save-list/.saves-"))
+	 (concat user-emacs-directory "auto-save-list/.saves-")))
   "Prefix for generating `auto-save-list-file-name'.
 This is used after reading your `.emacs' file to initialize
 `auto-save-list-file-name', by appending Emacs's pid and the system name,
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.554
diff -u -r1.554 subr.el
--- lisp/subr.el	22 Apr 2007 16:56:19 -0000	1.554
+++ lisp/subr.el	2 Jun 2007 22:11:43 -0000
@@ -2041,6 +2041,15 @@
 (put 'cl-assertion-failed 'error-conditions '(error))
 (put 'cl-assertion-failed 'error-message "Assertion failed")
 
+(defconst user-emacs-directory
+  (if (eq system-type 'ms-dos)
+      ;; MS-DOS cannot have initial dot.
+      "~/_emacs.d/"
+    "~/.emacs.d/")
+  "Directory beneath which additional per-user Emacs-specific files are placed.
+Various programs in Emacs store information in this directory.
+Note that this should end with a directory separator.")
+
 \f
 ;;;; Misc. useful functions.
 
Index: lisp/thumbs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/thumbs.el,v
retrieving revision 1.33
diff -u -r1.33 thumbs.el
--- lisp/thumbs.el	22 Apr 2007 13:44:43 -0000	1.33
+++ lisp/thumbs.el	2 Jun 2007 22:11:43 -0000
@@ -67,7 +67,7 @@
   :version "22.1"
   :group 'multimedia)
 
-(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs"
+(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
   "*Directory to store thumbnails."
   :type 'directory
   :group 'thumbs)
Index: lisp/tutorial.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tutorial.el,v
retrieving revision 1.16
diff -u -r1.16 tutorial.el
--- lisp/tutorial.el	16 May 2007 13:19:02 -0000	1.16
+++ lisp/tutorial.el	2 Jun 2007 22:11:43 -0000
@@ -611,8 +611,7 @@
 
 (defun tutorial--saved-dir ()
   "Directory to which tutorials are saved."
-  (expand-file-name "tutorial"
-		    (if (eq system-type 'ms-dos) "~/_emacs.d/" "~/.emacs.d/")))
+  (expand-file-name "tutorial" user-emacs-directory))
 
 (defun tutorial--saved-file ()
   "File name in which to save tutorials."
Index: lisp/play/gamegrid.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/play/gamegrid.el,v
retrieving revision 1.27
diff -u -r1.27 gamegrid.el
--- lisp/play/gamegrid.el	3 Mar 2007 12:15:23 -0000	1.27
+++ lisp/play/gamegrid.el	2 Jun 2007 22:11:43 -0000
@@ -66,7 +66,8 @@
 (defvar gamegrid-score-file-length 50
   "Number of high scores to keep")
 
-(defvar gamegrid-user-score-file-directory "~/.emacs.d/games"
+(defvar gamegrid-user-score-file-directory
+  (concat user-emacs-directory "games")
   "A directory for game scores which can't be shared.
 If Emacs was built without support for shared game scores, then this
 directory will be used.")
Index: lisp/term/x-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/x-win.el,v
retrieving revision 1.200
diff -u -r1.200 x-win.el
--- lisp/term/x-win.el	6 Mar 2007 05:50:48 -0000	1.200
+++ lisp/term/x-win.el	2 Jun 2007 22:11:43 -0000
@@ -263,7 +263,7 @@
 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
 a file in the home directory."
   (let ((basename (concat "session." session-id))
-	(emacs-dir "~/.emacs.d/"))
+	(emacs-dir user-emacs-directory))
     (expand-file-name (if (file-directory-p emacs-dir)
 			  (concat emacs-dir basename)
 			(concat "~/.emacs-" basename)))))
Index: lisp/url/url.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url.el,v
retrieving revision 1.27
diff -u -r1.27 url.el
--- lisp/url/url.el	21 Jan 2007 03:24:41 -0000	1.27
+++ lisp/url/url.el	2 Jun 2007 22:11:44 -0000
@@ -50,7 +50,8 @@
 (defvar url-configuration-directory
   (cond
    ((file-directory-p "~/.url") "~/.url")
-   ((file-directory-p "~/.emacs.d") "~/.emacs.d/url")
+   ((file-directory-p user-emacs-directory)
+    (concat user-emacs-directory "url"))
    (t "~/.url")))
 
 (defun url-do-setup ()
Index: lispref/os.texi
===================================================================
RCS file: /sources/emacs/emacs/lispref/os.texi,v
retrieving revision 1.106
diff -u -r1.106 os.texi
--- lispref/os.texi	7 Apr 2007 01:57:13 -0000	1.106
+++ lispref/os.texi	2 Jun 2007 22:11:44 -0000
@@ -258,6 +258,10 @@
 the value refers to the corresponding source file.
 @end defvar
 
+@defvar user-emacs-directory
+This variable holds the name of the @file{.emacs.d} directory.  It is
+ordinarily @file{~/.emacs.d}, but differs on some platforms.
+
 @node Terminal-Specific
 @subsection Terminal-Specific Initialization
 @cindex terminal-specific initialization

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-02 21:53   ` Tom Tromey
@ 2007-06-03  3:09     ` Eli Zaretskii
  2007-06-03  3:26       ` Tom Tromey
  2007-06-03 21:27     ` Richard Stallman
  1 sibling, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2007-06-03  3:09 UTC (permalink / raw)
  To: tromey; +Cc: emacs-devel

> From: Tom Tromey <tromey@redhat.com>
> Date: Sat, 02 Jun 2007 15:53:58 -0600
> Cc: emacs-devel@gnu.org
> 
> Here's a new patch that does document the new constant in the
> reference manual.  It also omits the ERC part of the patch since
> Michael has that in hand.
> 
> Comments?

You've removed quite a few of the calls to convert-standard-filename,
which I think is wrong.  Perhaps you thought that it exists only for
the MS-DOS port, but that assumption is false.

I suggest to leave convert-standard-filename where it was before your
change, to avoid inadvertent damage.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03  3:09     ` Eli Zaretskii
@ 2007-06-03  3:26       ` Tom Tromey
  2007-06-03  5:08         ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Tom Tromey @ 2007-06-03  3:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> You've removed quite a few of the calls to convert-standard-filename,
Eli> which I think is wrong.  Perhaps you thought that it exists only for
Eli> the MS-DOS port, but that assumption is false.

I see this hunk:

-     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
-      (convert-standard-filename
-       (expand-file-name "completions" "~/.emacs.d/")))
+     ((file-directory-p user-emacs-directory)
+      (expand-file-name "completions" user-emacs-directory))

I'm happy to reword this, but can you explain how this change can
cause failures?

Tom

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03  3:26       ` Tom Tromey
@ 2007-06-03  5:08         ` Eli Zaretskii
  2007-06-03 15:37           ` Tom Tromey
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2007-06-03  5:08 UTC (permalink / raw)
  To: tromey; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Tom Tromey <tromey@redhat.com>
> Reply-To: tromey@redhat.com
> Date: Sat, 02 Jun 2007 21:26:17 -0600
> 
> -     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
> -      (convert-standard-filename
> -       (expand-file-name "completions" "~/.emacs.d/")))
> +     ((file-directory-p user-emacs-directory)
> +      (expand-file-name "completions" user-emacs-directory))
> 
> I'm happy to reword this, but can you explain how this change can
> cause failures?

convert-standard-filename has a non-trivial definition on more systems
than just MS-DOS.  I don't think it's right to remove it, because
doing so have a potential of letting invalid file names creep into
Emacs on those systems.

IOW, I think leaving convert-standard-filename is good engineering,
not something for which I have specific failure scenarios.  In
general, we should run _all_ file names hard-wired into Emacs through
this function.

(I apologize for saying ``quite a few'' where evidently there's only
one instance of removal; in my defence I can only say that a quick
reading of the patch did somehow seem to remove
convert-standard-filename in more instances.)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03  5:08         ` Eli Zaretskii
@ 2007-06-03 15:37           ` Tom Tromey
  2007-06-03 16:47             ` Eli Zaretskii
  2007-06-13  0:13             ` Chong Yidong
  0 siblings, 2 replies; 15+ messages in thread
From: Tom Tromey @ 2007-06-03 15:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> IOW, I think leaving convert-standard-filename is good engineering,
Eli> not something for which I have specific failure scenarios.  In
Eli> general, we should run _all_ file names hard-wired into Emacs through
Eli> this function.

Here's an updated patch.

Tom

etc/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* NEWS: Mention user-emacs-directory.

lisp/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* subr.el (user-emacs-directory): New defconst.
	* cmuscheme.el (scheme-start-file): Use user-emacs-directory.
	* shell.el (shell): Use user-emacs-directory.
	* completion.el (save-completions-file-name): Use
	user-emacs-directory.
	* custom.el (custom-theme-directory): Use user-emacs-directory.
	* term/x-win.el (emacs-session-filename): Use
	user-emacs-directory.
	* filesets.el (filesets-menu-cache-file): Use
	user-emacs-directory.
	* thumbs.el (thumbs-thumbsdir): Use user-emacs-directory.
	* server.el (server-auth-dir): Use user-emacs-directory.
	* image-dired.el (image-dired-dir): Use user-emacs-directory.
	(image-dired-db-file): Likewise.
	(image-dired-temp-image-file): Likewise.
	(image-dired-gallery-dir): Likewise.
	(image-dired-temp-rotate-image-file): Likewise.
	* play/gamegrid.el (gamegrid-user-score-file-directory): Use
	user-emacs-directory.
	* savehist.el (savehist-file): Use user-emacs-directory.
	* tutorial.el (tutorial--saved-dir): Use user-emacs-directory.
	* startup.el (auto-save-list-file-prefix): Use
	user-emacs-directory.

lisp/url/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* url.el (url-configuration-directory): Use user-emacs-directory.

lispref/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* os.texi (Init File): Document user-emacs-directory.

Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1481
diff -u -r1.1481 NEWS
--- etc/NEWS	31 May 2007 00:52:35 -0000	1.1481
+++ etc/NEWS	3 Jun 2007 15:57:06 -0000
@@ -48,6 +48,10 @@
 \f
 * Lisp Changes in Emacs 23.1
 
+*** New variable `user-emacs-directory'.
+
+Use this instead of "~/.emacs.d".
+
 \f
 * New Packages for Lisp Programming in Emacs 23.1
 
Index: lisp/cmuscheme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/cmuscheme.el,v
retrieving revision 1.46
diff -u -r1.46 cmuscheme.el
--- lisp/cmuscheme.el	21 Jan 2007 03:53:12 -0000	1.46
+++ lisp/cmuscheme.el	3 Jun 2007 15:57:06 -0000
@@ -271,7 +271,7 @@
 order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
 	 (start-file (concat "~/.emacs_" progname))
-	 (alt-start-file (concat "~/.emacs.d/init_" progname ".scm")))
+	 (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
Index: lisp/completion.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/completion.el,v
retrieving revision 1.60
diff -u -r1.60 completion.el
--- lisp/completion.el	21 Jan 2007 03:53:12 -0000	1.60
+++ lisp/completion.el	3 Jun 2007 15:57:07 -0000
@@ -301,9 +301,9 @@
   (let ((olddef (convert-standard-filename "~/.completions")))
     (cond
      ((file-readable-p olddef) olddef)
-     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
+     ((file-directory-p user-emacs-directory)
       (convert-standard-filename
-       (expand-file-name "completions" "~/.emacs.d/")))
+       (expand-file-name "completions" user-emacs-directory)))
      (t olddef)))
   "The filename to save completions to."
   :type 'file
Index: lisp/custom.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/custom.el,v
retrieving revision 1.133
diff -u -r1.133 custom.el
--- lisp/custom.el	25 Apr 2007 04:44:28 -0000	1.133
+++ lisp/custom.el	3 Jun 2007 15:57:07 -0000
@@ -1009,10 +1009,7 @@
 ;;; Loading themes.
 
 (defcustom custom-theme-directory
-  (if (eq system-type 'ms-dos)
-	 ;; MS-DOS cannot have initial dot.
-	 "~/_emacs.d/"
-      "~/.emacs.d/")
+  user-emacs-directory
   "Directory in which Custom theme files should be written.
 `load-theme' searches this directory in addition to load-path.
 The command `customize-create-theme' writes the files it produces
Index: lisp/filesets.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/filesets.el,v
retrieving revision 1.32
diff -u -r1.32 filesets.el
--- lisp/filesets.el	21 Jan 2007 03:53:11 -0000	1.32
+++ lisp/filesets.el	3 Jun 2007 15:57:07 -0000
@@ -354,7 +354,7 @@
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
-      "~/.emacs.d/filesets-cache.el")
+    (concat user-emacs-directory "filesets-cache.el"))
   "*File to be used for saving the filesets menu between sessions.
 Set this to \"\", to disable caching of menus.
 Don't forget to check out `filesets-menu-ensure-use-cached'."
Index: lisp/image-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-dired.el,v
retrieving revision 1.3
diff -u -r1.3 image-dired.el
--- lisp/image-dired.el	28 Apr 2007 04:12:58 -0000	1.3
+++ lisp/image-dired.el	3 Jun 2007 15:57:07 -0000
@@ -166,7 +166,7 @@
   :prefix "image-dired-"
   :group 'multimedia)
 
-(defcustom image-dired-dir "~/.emacs.d/image-dired/"
+(defcustom image-dired-dir (concat user-emacs-directory "image-dired/")
   "Directory where thumbnail images are stored."
   :type 'string
   :group 'image-dired)
@@ -187,17 +187,20 @@
                  (const :tag "Per-directory" per-directory))
   :group 'image-dired)
 
-(defcustom image-dired-db-file "~/.emacs.d/image-dired/.image-dired_db"
+(defcustom image-dired-db-file
+  (concat user-emacs-directory "image-dired/.image-dired_db")
   "Database file where file names and their associated tags are stored."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-temp-image-file "~/.emacs.d/image-dired/.image-dired_temp"
+(defcustom image-dired-temp-image-file
+  (concat user-emacs-directory "image-dired/.image-dired_temp")
   "Name of temporary image file used by various commands."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-gallery-dir "~/.emacs.d/image-dired/.image-dired_gallery"
+(defcustom image-dired-gallery-dir
+  (concat user-emacs-directory "image-dired/.image-dired_gallery")
   "Directory to store generated gallery html pages.
 This path needs to be \"shared\" to the public so that it can access
 the index.html page that image-dired creates."
@@ -342,7 +345,7 @@
   :group 'image-dired)
 
 (defcustom image-dired-temp-rotate-image-file
-  "~/.emacs.d/image-dired/.image-dired_rotate_temp"
+  (concat user-emacs-directory "image-dired/.image-dired_rotate_temp")
   "Temporary file for rotate operations."
   :type 'string
   :group 'image-dired)
Index: lisp/savehist.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/savehist.el,v
retrieving revision 1.19
diff -u -r1.19 savehist.el
--- lisp/savehist.el	21 Jan 2007 03:53:11 -0000	1.19
+++ lisp/savehist.el	3 Jun 2007 15:57:07 -0000
@@ -101,8 +101,8 @@
   (cond
    ;; Backward compatibility with previous versions of savehist.
    ((file-exists-p "~/.emacs-history") "~/.emacs-history")
-   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
-    "~/.emacs.d/history")
+   ((and (not (featurep 'xemacs)) (file-directory-p user-emacs-directory))
+    (concat user-emacs-directory "history"))
    ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
     "~/.xemacs/history")
    ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
Index: lisp/server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.127
diff -u -r1.127 server.el
--- lisp/server.el	21 Mar 2007 12:02:32 -0000	1.127
+++ lisp/server.el	3 Jun 2007 15:57:07 -0000
@@ -105,7 +105,7 @@
   :version "22.1")
 (put 'server-host 'risky-local-variable t)
 
-(defcustom server-auth-dir "~/.emacs.d/server/"
+(defcustom server-auth-dir (concat user-emacs-directory "server/")
   "Directory for server authentication files."
   :group 'server
   :type 'directory
Index: lisp/shell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/shell.el,v
retrieving revision 1.149
diff -u -r1.149 shell.el
--- lisp/shell.el	4 Mar 2007 17:47:19 -0000	1.149
+++ lisp/shell.el	3 Jun 2007 15:57:07 -0000
@@ -557,7 +557,7 @@
 	   (startfile (concat "~/.emacs_" name))
 	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
       (unless (file-exists-p startfile)
-	(setq startfile (concat "~/.emacs.d/init_" name ".sh")))
+	(setq startfile (concat user-emacs-directory "init_" name ".sh")))
       (apply 'make-comint-in-buffer "shell" buffer prog
 	     (if (file-exists-p startfile) startfile)
 	     (if (and xargs-name (boundp xargs-name))
Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.437
diff -u -r1.437 startup.el
--- lisp/startup.el	11 May 2007 04:44:30 -0000	1.437
+++ lisp/startup.el	3 Jun 2007 15:57:08 -0000
@@ -263,9 +263,9 @@
 (defcustom auto-save-list-file-prefix
   (cond ((eq system-type 'ms-dos)
 	 ;; MS-DOS cannot have initial dot, and allows only 8.3 names
-	 "~/_emacs.d/auto-save.list/_s")
+	 (concat user-emacs-directory "auto-save.list/_s"))
 	(t
-	 "~/.emacs.d/auto-save-list/.saves-"))
+	 (concat user-emacs-directory "auto-save-list/.saves-")))
   "Prefix for generating `auto-save-list-file-name'.
 This is used after reading your `.emacs' file to initialize
 `auto-save-list-file-name', by appending Emacs's pid and the system name,
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.554
diff -u -r1.554 subr.el
--- lisp/subr.el	22 Apr 2007 16:56:19 -0000	1.554
+++ lisp/subr.el	3 Jun 2007 15:57:08 -0000
@@ -2041,6 +2041,15 @@
 (put 'cl-assertion-failed 'error-conditions '(error))
 (put 'cl-assertion-failed 'error-message "Assertion failed")
 
+(defconst user-emacs-directory
+  (if (eq system-type 'ms-dos)
+      ;; MS-DOS cannot have initial dot.
+      "~/_emacs.d/"
+    "~/.emacs.d/")
+  "Directory beneath which additional per-user Emacs-specific files are placed.
+Various programs in Emacs store information in this directory.
+Note that this should end with a directory separator.")
+
 \f
 ;;;; Misc. useful functions.
 
Index: lisp/thumbs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/thumbs.el,v
retrieving revision 1.33
diff -u -r1.33 thumbs.el
--- lisp/thumbs.el	22 Apr 2007 13:44:43 -0000	1.33
+++ lisp/thumbs.el	3 Jun 2007 15:57:08 -0000
@@ -67,7 +67,7 @@
   :version "22.1"
   :group 'multimedia)
 
-(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs"
+(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
   "*Directory to store thumbnails."
   :type 'directory
   :group 'thumbs)
Index: lisp/tutorial.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tutorial.el,v
retrieving revision 1.16
diff -u -r1.16 tutorial.el
--- lisp/tutorial.el	16 May 2007 13:19:02 -0000	1.16
+++ lisp/tutorial.el	3 Jun 2007 15:57:10 -0000
@@ -611,8 +611,7 @@
 
 (defun tutorial--saved-dir ()
   "Directory to which tutorials are saved."
-  (expand-file-name "tutorial"
-		    (if (eq system-type 'ms-dos) "~/_emacs.d/" "~/.emacs.d/")))
+  (expand-file-name "tutorial" user-emacs-directory))
 
 (defun tutorial--saved-file ()
   "File name in which to save tutorials."
Index: lisp/play/gamegrid.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/play/gamegrid.el,v
retrieving revision 1.27
diff -u -r1.27 gamegrid.el
--- lisp/play/gamegrid.el	3 Mar 2007 12:15:23 -0000	1.27
+++ lisp/play/gamegrid.el	3 Jun 2007 15:57:10 -0000
@@ -66,7 +66,8 @@
 (defvar gamegrid-score-file-length 50
   "Number of high scores to keep")
 
-(defvar gamegrid-user-score-file-directory "~/.emacs.d/games"
+(defvar gamegrid-user-score-file-directory
+  (concat user-emacs-directory "games")
   "A directory for game scores which can't be shared.
 If Emacs was built without support for shared game scores, then this
 directory will be used.")
Index: lisp/term/x-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/x-win.el,v
retrieving revision 1.200
diff -u -r1.200 x-win.el
--- lisp/term/x-win.el	6 Mar 2007 05:50:48 -0000	1.200
+++ lisp/term/x-win.el	3 Jun 2007 15:57:10 -0000
@@ -263,7 +263,7 @@
 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
 a file in the home directory."
   (let ((basename (concat "session." session-id))
-	(emacs-dir "~/.emacs.d/"))
+	(emacs-dir user-emacs-directory))
     (expand-file-name (if (file-directory-p emacs-dir)
 			  (concat emacs-dir basename)
 			(concat "~/.emacs-" basename)))))
Index: lisp/url/url.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url.el,v
retrieving revision 1.27
diff -u -r1.27 url.el
--- lisp/url/url.el	21 Jan 2007 03:24:41 -0000	1.27
+++ lisp/url/url.el	3 Jun 2007 15:57:10 -0000
@@ -50,7 +50,8 @@
 (defvar url-configuration-directory
   (cond
    ((file-directory-p "~/.url") "~/.url")
-   ((file-directory-p "~/.emacs.d") "~/.emacs.d/url")
+   ((file-directory-p user-emacs-directory)
+    (concat user-emacs-directory "url"))
    (t "~/.url")))
 
 (defun url-do-setup ()
Index: lispref/os.texi
===================================================================
RCS file: /sources/emacs/emacs/lispref/os.texi,v
retrieving revision 1.106
diff -u -r1.106 os.texi
--- lispref/os.texi	7 Apr 2007 01:57:13 -0000	1.106
+++ lispref/os.texi	3 Jun 2007 15:57:12 -0000
@@ -258,6 +258,10 @@
 the value refers to the corresponding source file.
 @end defvar
 
+@defvar user-emacs-directory
+This variable holds the name of the @file{.emacs.d} directory.  It is
+ordinarily @file{~/.emacs.d}, but differs on some platforms.
+
 @node Terminal-Specific
 @subsection Terminal-Specific Initialization
 @cindex terminal-specific initialization

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03 15:37           ` Tom Tromey
@ 2007-06-03 16:47             ` Eli Zaretskii
  2007-06-13  0:13             ` Chong Yidong
  1 sibling, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2007-06-03 16:47 UTC (permalink / raw)
  To: tromey; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Tom Tromey <tromey@redhat.com>
> Reply-To: tromey@redhat.com
> Date: Sun, 03 Jun 2007 09:37:39 -0600
> 
> Here's an updated patch.

Thanks, I'm happy now.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-02 21:53   ` Tom Tromey
  2007-06-03  3:09     ` Eli Zaretskii
@ 2007-06-03 21:27     ` Richard Stallman
  2007-06-03 22:20       ` Tom Tromey
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Stallman @ 2007-06-03 21:27 UTC (permalink / raw)
  To: tromey; +Cc: emacs-devel

    I looked through the user's manual but there didn't seem to be a very
    good place to do this.  And, this isn't a variable but a constant,
    since I think it doesn't make sense to let the user customize it.  So
    I'm hoping you will agree that it is ok to leave it as-is.

If users should not change it, I agree with you.

    +@defvar user-emacs-directory
    +This variable holds the name of the @file{.emacs.d} directory.  It is
    +ordinarily @file{~/.emacs.d}, but differs on some platforms.
    +

It needs @end defvar, but aside from that it is good.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03 21:27     ` Richard Stallman
@ 2007-06-03 22:20       ` Tom Tromey
  2007-06-04  5:01         ` Richard Stallman
  0 siblings, 1 reply; 15+ messages in thread
From: Tom Tromey @ 2007-06-03 22:20 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

>>>>> "rms" == Richard Stallman <rms@gnu.org> writes:

rms> It needs @end defvar, but aside from that it is good.

Thanks.  Here is an updated patch.

Tom

etc/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* NEWS: Mention user-emacs-directory.

lisp/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* subr.el (user-emacs-directory): New defconst.
	* cmuscheme.el (scheme-start-file): Use user-emacs-directory.
	* shell.el (shell): Use user-emacs-directory.
	* completion.el (save-completions-file-name): Use
	user-emacs-directory.
	* custom.el (custom-theme-directory): Use user-emacs-directory.
	* term/x-win.el (emacs-session-filename): Use
	user-emacs-directory.
	* filesets.el (filesets-menu-cache-file): Use
	user-emacs-directory.
	* thumbs.el (thumbs-thumbsdir): Use user-emacs-directory.
	* server.el (server-auth-dir): Use user-emacs-directory.
	* image-dired.el (image-dired-dir): Use user-emacs-directory.
	(image-dired-db-file): Likewise.
	(image-dired-temp-image-file): Likewise.
	(image-dired-gallery-dir): Likewise.
	(image-dired-temp-rotate-image-file): Likewise.
	* play/gamegrid.el (gamegrid-user-score-file-directory): Use
	user-emacs-directory.
	* savehist.el (savehist-file): Use user-emacs-directory.
	* tutorial.el (tutorial--saved-dir): Use user-emacs-directory.
	* startup.el (auto-save-list-file-prefix): Use
	user-emacs-directory.

lisp/url/ChangeLog
2007-06-02  Tom Tromey  <tromey@redhat.com>

	* url.el (url-configuration-directory): Use user-emacs-directory.

lispref/ChangeLog
2007-06-03  Tom Tromey  <tromey@redhat.com>

	* os.texi (Init File): Document user-emacs-directory.

Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1482
diff -u -r1.1482 NEWS
--- etc/NEWS	3 Jun 2007 18:51:42 -0000	1.1482
+++ etc/NEWS	3 Jun 2007 22:34:41 -0000
@@ -50,6 +50,10 @@
 \f
 * Lisp Changes in Emacs 23.1
 
+*** New variable `user-emacs-directory'.
+
+Use this instead of "~/.emacs.d".
+
 \f
 * New Packages for Lisp Programming in Emacs 23.1
 
Index: lisp/cmuscheme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/cmuscheme.el,v
retrieving revision 1.46
diff -u -r1.46 cmuscheme.el
--- lisp/cmuscheme.el	21 Jan 2007 03:53:12 -0000	1.46
+++ lisp/cmuscheme.el	3 Jun 2007 22:34:41 -0000
@@ -271,7 +271,7 @@
 order.  Return nil if no start file found."
   (let* ((progname (file-name-nondirectory prog))
 	 (start-file (concat "~/.emacs_" progname))
-	 (alt-start-file (concat "~/.emacs.d/init_" progname ".scm")))
+	 (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
     (if (file-exists-p start-file)
         start-file
       (and (file-exists-p alt-start-file) alt-start-file))))
Index: lisp/completion.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/completion.el,v
retrieving revision 1.60
diff -u -r1.60 completion.el
--- lisp/completion.el	21 Jan 2007 03:53:12 -0000	1.60
+++ lisp/completion.el	3 Jun 2007 22:34:42 -0000
@@ -301,9 +301,9 @@
   (let ((olddef (convert-standard-filename "~/.completions")))
     (cond
      ((file-readable-p olddef) olddef)
-     ((file-directory-p (convert-standard-filename "~/.emacs.d/"))
+     ((file-directory-p user-emacs-directory)
       (convert-standard-filename
-       (expand-file-name "completions" "~/.emacs.d/")))
+       (expand-file-name "completions" user-emacs-directory)))
      (t olddef)))
   "The filename to save completions to."
   :type 'file
Index: lisp/custom.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/custom.el,v
retrieving revision 1.133
diff -u -r1.133 custom.el
--- lisp/custom.el	25 Apr 2007 04:44:28 -0000	1.133
+++ lisp/custom.el	3 Jun 2007 22:34:42 -0000
@@ -1009,10 +1009,7 @@
 ;;; Loading themes.
 
 (defcustom custom-theme-directory
-  (if (eq system-type 'ms-dos)
-	 ;; MS-DOS cannot have initial dot.
-	 "~/_emacs.d/"
-      "~/.emacs.d/")
+  user-emacs-directory
   "Directory in which Custom theme files should be written.
 `load-theme' searches this directory in addition to load-path.
 The command `customize-create-theme' writes the files it produces
Index: lisp/filesets.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/filesets.el,v
retrieving revision 1.32
diff -u -r1.32 filesets.el
--- lisp/filesets.el	21 Jan 2007 03:53:11 -0000	1.32
+++ lisp/filesets.el	3 Jun 2007 22:34:42 -0000
@@ -354,7 +354,7 @@
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
-      "~/.emacs.d/filesets-cache.el")
+    (concat user-emacs-directory "filesets-cache.el"))
   "*File to be used for saving the filesets menu between sessions.
 Set this to \"\", to disable caching of menus.
 Don't forget to check out `filesets-menu-ensure-use-cached'."
Index: lisp/image-dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-dired.el,v
retrieving revision 1.3
diff -u -r1.3 image-dired.el
--- lisp/image-dired.el	28 Apr 2007 04:12:58 -0000	1.3
+++ lisp/image-dired.el	3 Jun 2007 22:34:42 -0000
@@ -166,7 +166,7 @@
   :prefix "image-dired-"
   :group 'multimedia)
 
-(defcustom image-dired-dir "~/.emacs.d/image-dired/"
+(defcustom image-dired-dir (concat user-emacs-directory "image-dired/")
   "Directory where thumbnail images are stored."
   :type 'string
   :group 'image-dired)
@@ -187,17 +187,20 @@
                  (const :tag "Per-directory" per-directory))
   :group 'image-dired)
 
-(defcustom image-dired-db-file "~/.emacs.d/image-dired/.image-dired_db"
+(defcustom image-dired-db-file
+  (concat user-emacs-directory "image-dired/.image-dired_db")
   "Database file where file names and their associated tags are stored."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-temp-image-file "~/.emacs.d/image-dired/.image-dired_temp"
+(defcustom image-dired-temp-image-file
+  (concat user-emacs-directory "image-dired/.image-dired_temp")
   "Name of temporary image file used by various commands."
   :type 'string
   :group 'image-dired)
 
-(defcustom image-dired-gallery-dir "~/.emacs.d/image-dired/.image-dired_gallery"
+(defcustom image-dired-gallery-dir
+  (concat user-emacs-directory "image-dired/.image-dired_gallery")
   "Directory to store generated gallery html pages.
 This path needs to be \"shared\" to the public so that it can access
 the index.html page that image-dired creates."
@@ -342,7 +345,7 @@
   :group 'image-dired)
 
 (defcustom image-dired-temp-rotate-image-file
-  "~/.emacs.d/image-dired/.image-dired_rotate_temp"
+  (concat user-emacs-directory "image-dired/.image-dired_rotate_temp")
   "Temporary file for rotate operations."
   :type 'string
   :group 'image-dired)
Index: lisp/savehist.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/savehist.el,v
retrieving revision 1.19
diff -u -r1.19 savehist.el
--- lisp/savehist.el	21 Jan 2007 03:53:11 -0000	1.19
+++ lisp/savehist.el	3 Jun 2007 22:34:42 -0000
@@ -101,8 +101,8 @@
   (cond
    ;; Backward compatibility with previous versions of savehist.
    ((file-exists-p "~/.emacs-history") "~/.emacs-history")
-   ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
-    "~/.emacs.d/history")
+   ((and (not (featurep 'xemacs)) (file-directory-p user-emacs-directory))
+    (concat user-emacs-directory "history"))
    ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
     "~/.xemacs/history")
    ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
Index: lisp/server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.127
diff -u -r1.127 server.el
--- lisp/server.el	21 Mar 2007 12:02:32 -0000	1.127
+++ lisp/server.el	3 Jun 2007 22:34:42 -0000
@@ -105,7 +105,7 @@
   :version "22.1")
 (put 'server-host 'risky-local-variable t)
 
-(defcustom server-auth-dir "~/.emacs.d/server/"
+(defcustom server-auth-dir (concat user-emacs-directory "server/")
   "Directory for server authentication files."
   :group 'server
   :type 'directory
Index: lisp/shell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/shell.el,v
retrieving revision 1.149
diff -u -r1.149 shell.el
--- lisp/shell.el	4 Mar 2007 17:47:19 -0000	1.149
+++ lisp/shell.el	3 Jun 2007 22:34:42 -0000
@@ -557,7 +557,7 @@
 	   (startfile (concat "~/.emacs_" name))
 	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
       (unless (file-exists-p startfile)
-	(setq startfile (concat "~/.emacs.d/init_" name ".sh")))
+	(setq startfile (concat user-emacs-directory "init_" name ".sh")))
       (apply 'make-comint-in-buffer "shell" buffer prog
 	     (if (file-exists-p startfile) startfile)
 	     (if (and xargs-name (boundp xargs-name))
Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.437
diff -u -r1.437 startup.el
--- lisp/startup.el	11 May 2007 04:44:30 -0000	1.437
+++ lisp/startup.el	3 Jun 2007 22:34:43 -0000
@@ -263,9 +263,9 @@
 (defcustom auto-save-list-file-prefix
   (cond ((eq system-type 'ms-dos)
 	 ;; MS-DOS cannot have initial dot, and allows only 8.3 names
-	 "~/_emacs.d/auto-save.list/_s")
+	 (concat user-emacs-directory "auto-save.list/_s"))
 	(t
-	 "~/.emacs.d/auto-save-list/.saves-"))
+	 (concat user-emacs-directory "auto-save-list/.saves-")))
   "Prefix for generating `auto-save-list-file-name'.
 This is used after reading your `.emacs' file to initialize
 `auto-save-list-file-name', by appending Emacs's pid and the system name,
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.554
diff -u -r1.554 subr.el
--- lisp/subr.el	22 Apr 2007 16:56:19 -0000	1.554
+++ lisp/subr.el	3 Jun 2007 22:34:43 -0000
@@ -2041,6 +2041,15 @@
 (put 'cl-assertion-failed 'error-conditions '(error))
 (put 'cl-assertion-failed 'error-message "Assertion failed")
 
+(defconst user-emacs-directory
+  (if (eq system-type 'ms-dos)
+      ;; MS-DOS cannot have initial dot.
+      "~/_emacs.d/"
+    "~/.emacs.d/")
+  "Directory beneath which additional per-user Emacs-specific files are placed.
+Various programs in Emacs store information in this directory.
+Note that this should end with a directory separator.")
+
 \f
 ;;;; Misc. useful functions.
 
Index: lisp/thumbs.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/thumbs.el,v
retrieving revision 1.33
diff -u -r1.33 thumbs.el
--- lisp/thumbs.el	22 Apr 2007 13:44:43 -0000	1.33
+++ lisp/thumbs.el	3 Jun 2007 22:34:43 -0000
@@ -67,7 +67,7 @@
   :version "22.1"
   :group 'multimedia)
 
-(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs"
+(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
   "*Directory to store thumbnails."
   :type 'directory
   :group 'thumbs)
Index: lisp/tutorial.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tutorial.el,v
retrieving revision 1.16
diff -u -r1.16 tutorial.el
--- lisp/tutorial.el	16 May 2007 13:19:02 -0000	1.16
+++ lisp/tutorial.el	3 Jun 2007 22:34:43 -0000
@@ -611,8 +611,7 @@
 
 (defun tutorial--saved-dir ()
   "Directory to which tutorials are saved."
-  (expand-file-name "tutorial"
-		    (if (eq system-type 'ms-dos) "~/_emacs.d/" "~/.emacs.d/")))
+  (expand-file-name "tutorial" user-emacs-directory))
 
 (defun tutorial--saved-file ()
   "File name in which to save tutorials."
Index: lisp/play/gamegrid.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/play/gamegrid.el,v
retrieving revision 1.27
diff -u -r1.27 gamegrid.el
--- lisp/play/gamegrid.el	3 Mar 2007 12:15:23 -0000	1.27
+++ lisp/play/gamegrid.el	3 Jun 2007 22:34:44 -0000
@@ -66,7 +66,8 @@
 (defvar gamegrid-score-file-length 50
   "Number of high scores to keep")
 
-(defvar gamegrid-user-score-file-directory "~/.emacs.d/games"
+(defvar gamegrid-user-score-file-directory
+  (concat user-emacs-directory "games")
   "A directory for game scores which can't be shared.
 If Emacs was built without support for shared game scores, then this
 directory will be used.")
Index: lisp/term/x-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/x-win.el,v
retrieving revision 1.200
diff -u -r1.200 x-win.el
--- lisp/term/x-win.el	6 Mar 2007 05:50:48 -0000	1.200
+++ lisp/term/x-win.el	3 Jun 2007 22:34:44 -0000
@@ -263,7 +263,7 @@
 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
 a file in the home directory."
   (let ((basename (concat "session." session-id))
-	(emacs-dir "~/.emacs.d/"))
+	(emacs-dir user-emacs-directory))
     (expand-file-name (if (file-directory-p emacs-dir)
 			  (concat emacs-dir basename)
 			(concat "~/.emacs-" basename)))))
Index: lisp/url/url.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url.el,v
retrieving revision 1.27
diff -u -r1.27 url.el
--- lisp/url/url.el	21 Jan 2007 03:24:41 -0000	1.27
+++ lisp/url/url.el	3 Jun 2007 22:34:44 -0000
@@ -50,7 +50,8 @@
 (defvar url-configuration-directory
   (cond
    ((file-directory-p "~/.url") "~/.url")
-   ((file-directory-p "~/.emacs.d") "~/.emacs.d/url")
+   ((file-directory-p user-emacs-directory)
+    (concat user-emacs-directory "url"))
    (t "~/.url")))
 
 (defun url-do-setup ()
Index: lispref/os.texi
===================================================================
RCS file: /sources/emacs/emacs/lispref/os.texi,v
retrieving revision 1.106
diff -u -r1.106 os.texi
--- lispref/os.texi	7 Apr 2007 01:57:13 -0000	1.106
+++ lispref/os.texi	3 Jun 2007 22:34:45 -0000
@@ -258,6 +258,11 @@
 the value refers to the corresponding source file.
 @end defvar
 
+@defvar user-emacs-directory
+This variable holds the name of the @file{.emacs.d} directory.  It is
+ordinarily @file{~/.emacs.d}, but differs on some platforms.
+@end defvar
+
 @node Terminal-Specific
 @subsection Terminal-Specific Initialization
 @cindex terminal-specific initialization

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03 22:20       ` Tom Tromey
@ 2007-06-04  5:01         ` Richard Stallman
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Stallman @ 2007-06-04  5:01 UTC (permalink / raw)
  To: tromey; +Cc: emacs-devel

I don't have time to study the code, but when others see no more
problems, it can be installed.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-13  0:13             ` Chong Yidong
@ 2007-06-13  0:02               ` Tom Tromey
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Tromey @ 2007-06-13  0:02 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Eli Zaretskii, emacs-devel

Chong> I've checked the patch into the trunk.

I don't recall whether I sent out the version that fixed the .texi bug
that RMS saw.  I've appended the fix.  Sorry about this.

Tom

Index: lispref/os.texi
===================================================================
RCS file: /sources/emacs/emacs/lispref/os.texi,v
retrieving revision 1.107
diff -u -r1.107 os.texi
--- lispref/os.texi	13 Jun 2007 00:08:25 -0000	1.107
+++ lispref/os.texi	13 Jun 2007 00:19:42 -0000
@@ -261,6 +261,7 @@
 @defvar user-emacs-directory
 This variable holds the name of the @file{.emacs.d} directory.  It is
 ordinarily @file{~/.emacs.d}, but differs on some platforms.
+@end defvar
 
 @node Terminal-Specific
 @subsection Terminal-Specific Initialization

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Patch for user-emacs-directory
  2007-06-03 15:37           ` Tom Tromey
  2007-06-03 16:47             ` Eli Zaretskii
@ 2007-06-13  0:13             ` Chong Yidong
  2007-06-13  0:02               ` Tom Tromey
  1 sibling, 1 reply; 15+ messages in thread
From: Chong Yidong @ 2007-06-13  0:13 UTC (permalink / raw)
  To: tromey; +Cc: Eli Zaretskii, emacs-devel

Tom Tromey <tromey@redhat.com> writes:

> Here's an updated patch.
>
> Tom

I've checked the patch into the trunk.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-06-13  0:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-27 21:24 Patch for user-emacs-directory Tom Tromey
2007-05-27 22:47 ` Leo
2007-05-28 14:37 ` Richard Stallman
2007-06-02 21:53   ` Tom Tromey
2007-06-03  3:09     ` Eli Zaretskii
2007-06-03  3:26       ` Tom Tromey
2007-06-03  5:08         ` Eli Zaretskii
2007-06-03 15:37           ` Tom Tromey
2007-06-03 16:47             ` Eli Zaretskii
2007-06-13  0:13             ` Chong Yidong
2007-06-13  0:02               ` Tom Tromey
2007-06-03 21:27     ` Richard Stallman
2007-06-03 22:20       ` Tom Tromey
2007-06-04  5:01         ` Richard Stallman
2007-05-30  1:32 ` Michael Olson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.