From: Tom Tromey <tromey@redhat.com>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Patch for user-emacs-directory
Date: Sun, 03 Jun 2007 16:20:58 -0600 [thread overview]
Message-ID: <m3r6oshe7p.fsf@fleche.redhat.com> (raw)
In-Reply-To: <E1HuxbL-0005y2-HL@fencepost.gnu.org> (Richard Stallman's message of "Sun\, 03 Jun 2007 17\:27\:03 -0400")
>>>>> "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
next prev parent reply other threads:[~2007-06-03 22:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-06-04 5:01 ` Richard Stallman
2007-05-30 1:32 ` Michael Olson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r6oshe7p.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.