From: Eli Zaretskii <eliz@gnu.org>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: petewil@google.com, emacs-devel@gnu.org
Subject: Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user")
Date: Tue, 03 Mar 2015 20:09:56 +0200 [thread overview]
Message-ID: <83y4neosuj.fsf@gnu.org> (raw)
In-Reply-To: <xa1tmw3urmzb.fsf@mina86.com>
> From: Michal Nazarewicz <mina86@mina86.com>
> Cc: petewil@google.com, emacs-devel@gnu.org
> Date: Tue, 03 Mar 2015 18:48:24 +0100
>
> > It's a lie, and one that's tricky to untangle: you need to know that
> > to get a _real_ file name, you need to run it through
> > expand-file-name. If you don't, things will subtly fail, e.g., if you
> > compare this with some other file name.
>
> This is already a problem on *all* systems and it happens if user init
> file is not found. If you run ‘emacs -u foo’ on GNU/Linux, you’ll end
> up with `user-init-file" equal to "~foo/.emacs".
I don't understand how what you say is a contradiction to what I said.
> > Another important piece of the puzzle is that if USER is not
> > recognized as a valid user by the getpwnam emulation on
> > MS-Windows/MS-DOS, you get this:
> >
> > (expand-file-name "~USER") => /current/directory/~USER
> >
> > And it is possible to have a literal "~USER" directory, in which case
> > the warning will be incorrectly skipped.
>
> This also happens on UNIX-like systems.
Of course, it does. So what?
> Based on all that, I think the most consistent option is to:
>
> 1) always check if ~USER/ directory exists for the ‘User foo has no home
> directory’ warning;
>
> 2) user ~USER/.emacs and ~USER/_emacs on MS-Windows; and
>
> 3) use `expand-file-name' when setting `user-init-file' if init file has
> not been loaded.
Sorry, I cannot follow the logic that led to these 3 conclusions.
Please explain. (And don't we already do all that?)
> The below untested patch does that plus stops Emacs from attempting to
> load init file if `init-file-user' is ‘invalid’, i.e. contains ~, /, :
> or \n.
Why?
next prev parent reply other threads:[~2015-03-03 18:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 0:06 [PATCH] for review - Allow expansion of "~" (as opposed to "~user") Pete Williamson
2015-02-28 8:08 ` Eli Zaretskii
2015-03-02 9:44 ` Michal Nazarewicz
2015-03-02 13:50 ` Eli Zaretskii
2015-03-02 20:37 ` Michal Nazarewicz
2015-03-03 15:37 ` Eli Zaretskii
2015-03-03 17:48 ` Michal Nazarewicz
2015-03-03 18:09 ` Eli Zaretskii [this message]
2015-03-03 18:20 ` Eli Zaretskii
2015-03-03 18:22 ` Pete Williamson
2015-03-03 18:36 ` Eli Zaretskii
2015-03-03 18:38 ` Pete Williamson
2015-03-03 21:01 ` Michal Nazarewicz
2015-03-03 21:03 ` Michal Nazarewicz
2015-03-04 18:06 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83y4neosuj.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=mina86@mina86.com \
--cc=petewil@google.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).