From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] for review - Allow expansion of "~" (as opposed to "~user") Date: Sat, 28 Feb 2015 10:08:27 +0200 Message-ID: <83r3ta4fwk.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1425110907 28351 80.91.229.3 (28 Feb 2015 08:08:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Feb 2015 08:08:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Pete Williamson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 28 09:08:19 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YRcRc-0003go-OI for ged-emacs-devel@m.gmane.org; Sat, 28 Feb 2015 09:08:16 +0100 Original-Received: from localhost ([::1]:40302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRcRb-0006kK-3p for ged-emacs-devel@m.gmane.org; Sat, 28 Feb 2015 03:08:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRcRY-0006hb-59 for emacs-devel@gnu.org; Sat, 28 Feb 2015 03:08:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRcRU-0000Wq-Sj for emacs-devel@gnu.org; Sat, 28 Feb 2015 03:08:12 -0500 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:36205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRcRU-0000WJ-LX for emacs-devel@gnu.org; Sat, 28 Feb 2015 03:08:08 -0500 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NKH00F002AMYF00@mtaout28.012.net.il> for emacs-devel@gnu.org; Sat, 28 Feb 2015 10:06:37 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NKH00ECD2J1LT20@mtaout28.012.net.il>; Sat, 28 Feb 2015 10:06:37 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183532 Archived-At: > Date: Fri, 27 Feb 2015 16:06:02 -0800 > From: Pete Williamson > > 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.