unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: petewil@google.com, emacs-devel@gnu.org
Subject: Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user")
Date: Mon, 02 Mar 2015 21:37:56 +0100	[thread overview]
Message-ID: <xa1tmw3v2l0b.fsf@mina86.com> (raw)
In-Reply-To: <837fuzse3n.fsf@gnu.org>

On Mon, Mar 02 2015, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Michal Nazarewicz <mina86@mina86.com>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 02 Mar 2015 10:44:07 +0100
>> 
>> Looking at that code, it appears it’s inconsistent on Windows when it
>> comes to handling ~/.emacs.d/init.el.  If I understand it correctly,
>> here’s how Emacs behave on Windows:
>> 
>> * emacs        -> load ~/.emacs, ~/_emacs or ~/.emacs.d/init.el
>> * emacs -u foo -> load ~/.emacs or ~/_emacs
>
> I'm not bothered about the inconsistency, since the "-u foo"
> "handling" is a kludge for a situation that shouldn't happen.  I
> wouldn't object to emitting an error in that case.

Doesn’t this basically mean doing this:

-       (if (file-directory-p (expand-file-name
-                              ;; We don't support ~USER on MS-Windows
-                              ;; and MS-DOS except for the current
-                              ;; user, and always load .emacs from
-                              ;; the current user's home directory
-                              ;; (see below).  So always check "~",
-                              ;; even if invoked with "-u USER", or
-                              ;; if $USER or $LOGNAME are set to
-                              ;; something different.
-                              (if (memq system-type '(windows-nt ms-dos))
-                                  "~"
-                                (concat "~" init-file-user))))
-           nil
-         (display-warning 'initialization
+       (unless (file-directory-p (expand-file-name
+                                   (concat "~" init-file-user)))
+          (display-warning 'initialization

and then using ~user/… for every system including windows-nt?

If I understand correctly, ~user/… expansion depends on getpwnam and a)
on MS-DOS DJGPP provides it (by having a single pw entry for user ==
current user), b) on W32 src/w32.c provides it (with the same
implementation) and on POSIX we have it properly implemented.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--



  reply	other threads:[~2015-03-02 20:37 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 [this message]
2015-03-03 15:37         ` Eli Zaretskii
2015-03-03 17:48           ` Michal Nazarewicz
2015-03-03 18:09             ` Eli Zaretskii
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=xa1tmw3v2l0b.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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).