emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user")


From: Michal Nazarewicz
Subject: Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user")
Date: Mon, 02 Mar 2015 21:37:56 +0100
User-agent: Notmuch/0.19+53~g2e63a09 (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-unknown-linux-gnu)

On Mon, Mar 02 2015, Eli Zaretskii <address@hidden> wrote:
>> From: Michal Nazarewicz <address@hidden>
>> Cc: address@hidden
>> 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 +--<address@hidden>--<xmpp:address@hidden>--ooO--(_)--Ooo--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]