[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user")
From: |
Eli Zaretskii |
Subject: |
Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user") |
Date: |
Sat, 28 Feb 2015 10:08:27 +0200 |
> Date: Fri, 27 Feb 2015 16:06:02 -0800
> From: Pete Williamson <address@hidden>
>
> I'm porting Emacs to run on NaCl (Chrome Native Client) and the Chromebook.
> (You can see slides about this in the FOSDEM 2015 archives).
>
> The NaCl platform does not support expanding the "~user" syntax for filenames
> (where user is the name of the logged in user), but it does support expanding
> "~" in filenames when looking for the init.el file.
>
> I've made a patch to startup.el to check in "~" for .emacs.d/init.el if it is
> not found in "~user". Is taking this patch a good idea? I'm not sure how much
> emacs should adapt to the platform, and how much should be done in a private
> patch that does not affect other platforms, and I would be grateful for any
> guidance.
>
> Currently for the NaCl port, we have a patch in naclports which does OS
> specific fixes, and I can leave this patch in naclports if that is thought by
> others to be a better place, or I would be happy to contribute it back to Gnu
> if it is seen as generally useful.
>
> All comments on the patch welcome.
Simply reuse for NaCl what we already do for MS-Windows:
(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))))
If you still need something beyond that, please explain why, as the
situation you describe seems to be identical to what happens on
MS-Windows.