From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: "Juanma Barranquero" <lekktu@gmail.com>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Don't concat directories to file names
Date: Fri, 15 Jun 2007 23:19:19 +0900 [thread overview]
Message-ID: <87hcp9cnbs.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <f7ccd24b0706150421ra431c9eofc0c6b11dbe066c2@mail.gmail.com>
Juanma Barranquero writes:
> Then the recently introduced `user-emacs-directory' should be renamed
> to `user-init-directory', or aliased, I think (but it doesn't make
> much sense to alias a just created var). The variable currently must
> end with a directory separator, but that could be fixed.
I think requiring the directory separator on the variable is
reasonable; after all, in most cases it will be determined implicitly
at startup or by a function call. The trick of doing
(defun user-init-directory ()
"Return the per-user directory holding Emacs configuration files."
(if (and (boundp 'user-init-directory)
(file-directory-p user-init-directory))
user-init-directory
(find-user-init-directory))) ; this may be oversimplified
is always available, too.
> (defun user-emacs-file (name &optional new-name)
> "Convert NAME to an absolute per-user Emacs-specific path.
> If \"~/NAME\" exists, or `user-emacs-directory' is nil, return \"~/NAME\".
> Else, return \"`user-emacs-directory'/NEW-NAME\", or /NAME if NEW-NAME is nil."
Looks reasonable to me. FWIW, existing XEmacs practice is to
encourage use of `user-init-directory' by looking there first (for our
startup files; we don't have the API you are proposing yet, so other
libraries have to code by hand). Also, if ~/.emacs is found,
~/.xemacs/ doesn't exist, and migration is not inhibited, XEmacs
offers to migrate its files (.emacs and optionally custom.el) from
$HOME to `user-init-directory'. If you say no, you get the option of
trying again later, or telling XEmacs not to bug you any more.
> People wanting to use the same setup files in X?Emacs will have to
> make user-(emacs|init)-directory point to the right place, or perhaps
> set it to nil (and then `user-emacs-file' defers to ~/ and does not
> try to create any dir).
XEmacs has -user-init-file and -user-init-directory options to handle
this (as well as the -u option).
I'm at my limit here: I can imagine use cases for all this
flexibility, but I've never encountered them in the wild. I think
that `user-emacs-directory' and `user-init-directory' have similar
enough semantics that it would be nice if the variable name could be
the same. I'd like to claim priority for `user-init-directory': it's
over ten years old in XEmacs.
Other than that, it's not at all obvious to me that any of XEmacs's
APIs or UIs in this area are used often enough to worry about
incompatibility. I'm not a big fan of the name "user-emacs-file" for
the function you've defined; for me, even after all this time using
the ~/.xemacs/init.el style, I think it should point to ".emacs". How
does "user-configuration-file" or "find-user-configuration-file"
sound? (Of course "configuration" could be shortened to "config".)
next prev parent reply other threads:[~2007-06-15 14:19 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-13 16:22 Don't concat directories to file names Richard Stallman
2007-06-14 15:16 ` Juanma Barranquero
2007-06-14 17:10 ` Stephen J. Turnbull
2007-06-14 21:12 ` Juanma Barranquero
2007-06-15 1:50 ` Stephen J. Turnbull
2007-06-15 7:55 ` Juanma Barranquero
2007-06-15 9:15 ` Juanma Barranquero
2007-06-15 10:20 ` Stephen J. Turnbull
2007-06-15 11:21 ` Juanma Barranquero
2007-06-15 14:19 ` Stephen J. Turnbull [this message]
2007-06-15 16:27 ` Juanma Barranquero
2007-06-15 18:09 ` Stephen J. Turnbull
2007-06-15 14:33 ` Stefan Monnier
2007-06-15 16:39 ` Miles Bader
2007-06-15 16:41 ` Juanma Barranquero
2007-06-16 0:38 ` Miles Bader
2007-06-16 0:50 ` Juanma Barranquero
2007-06-16 3:28 ` Stefan Monnier
2007-06-16 3:30 ` Juanma Barranquero
2007-06-16 4:53 ` Stephen J. Turnbull
2007-06-15 22:45 ` Richard Stallman
2007-06-15 23:25 ` Juanma Barranquero
2007-06-16 18:50 ` Richard Stallman
2007-06-16 19:20 ` Juanma Barranquero
2007-06-16 20:19 ` Stephen J. Turnbull
2007-06-17 12:36 ` Stefan Monnier
2007-06-18 7:25 ` Richard Stallman
2007-06-18 7:38 ` David Kastrup
2007-06-20 13:29 ` Richard Stallman
2007-06-20 13:39 ` Juanma Barranquero
2007-06-20 14:29 ` Stephen J. Turnbull
2007-06-20 14:59 ` Juanma Barranquero
2007-06-21 1:07 ` Richard Stallman
2007-06-21 8:08 ` Kai Grossjohann
2007-06-21 8:23 ` Juanma Barranquero
2007-06-22 1:51 ` Richard Stallman
2007-06-22 7:55 ` Juanma Barranquero
2007-06-22 18:51 ` Richard Stallman
2007-06-22 18:51 ` Richard Stallman
2007-06-25 9:59 ` Juanma Barranquero
2007-06-25 14:33 ` Stefan Monnier
2007-06-25 14:51 ` Juanma Barranquero
2007-06-25 14:54 ` David Kastrup
2007-06-25 15:00 ` David Kastrup
2007-06-25 16:27 ` Stefan Monnier
2007-06-25 18:23 ` Juanma Barranquero
2007-06-25 18:32 ` David Kastrup
2007-06-25 18:46 ` Juanma Barranquero
2007-06-26 0:16 ` Stephen J. Turnbull
2007-06-25 16:29 ` Stefan Monnier
2007-06-25 18:27 ` Juanma Barranquero
2007-06-25 19:49 ` Andreas Schwab
2007-06-25 20:35 ` Eli Zaretskii
2007-06-25 20:39 ` David Kastrup
2007-06-25 20:58 ` Eli Zaretskii
2007-06-25 15:46 ` Richard Stallman
2007-06-21 1:07 ` Richard Stallman
2007-06-21 2:24 ` Stephen J. Turnbull
2007-06-21 8:11 ` Juanma Barranquero
2007-06-21 8:23 ` David Kastrup
2007-06-21 8:46 ` Juanma Barranquero
2007-06-16 5:16 ` Stephen J. Turnbull
2007-06-16 18:50 ` Richard Stallman
2007-06-15 16:40 ` Juanma Barranquero
2007-06-14 19:51 ` Tom Tromey
2007-06-14 21:17 ` Juanma Barranquero
2007-06-14 21:32 ` Stefan Monnier
2007-06-14 21:39 ` Juanma Barranquero
2007-06-15 7:29 ` Eli Zaretskii
2007-06-15 7:56 ` Juanma Barranquero
2007-06-14 19:40 ` Tom Tromey
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=87hcp9cnbs.fsf@uwakimon.sk.tsukuba.ac.jp \
--to=stephen@xemacs.org \
--cc=emacs-devel@gnu.org \
--cc=lekktu@gmail.com \
--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.