From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: path, cwd in NS port Date: Thu, 28 May 2020 13:45:17 -0400 Message-ID: References: <20200528110037.53f0b487@jabberwock.cb.piermont.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="96239"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: "Perry E. Metzger" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 28 19:46:14 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeMbe-000Ovl-27 for ged-emacs-devel@m.gmane-mx.org; Thu, 28 May 2020 19:46:14 +0200 Original-Received: from localhost ([::1]:54720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeMbd-0008BF-38 for ged-emacs-devel@m.gmane-mx.org; Thu, 28 May 2020 13:46:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeMap-0007Vo-AJ for emacs-devel@gnu.org; Thu, 28 May 2020 13:45:23 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeMan-0002pT-Vu for emacs-devel@gnu.org; Thu, 28 May 2020 13:45:22 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 509561002AC; Thu, 28 May 2020 13:45:20 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 99FC4100275; Thu, 28 May 2020 13:45:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1590687918; bh=KeH+f36DjARaCO2v9B+3uxVr4P5F3B7NoKDLG/HDsl8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Mkl439twGArd++CKZ997p/5FdvjPoAy60mVusAQDjwXlQimzTgJdpy+Xiw6MJuLev 2MbhIKTwQaqEai4jD5jsrvTGZgJX7YTogDy8uzYsdLsZoA4WfQFsTFLCmdMfXPCIgj Ds/Pisuu4TcGWnXLJdPlFRKYq+kZj1BfOAma7/VGZFamYsNxv1EDIplSZHzok2FAHi MuQZzcEw/sCm0z2t156NwFuaetiZ4fa6VLW9iNO+xErjPjjSBdJ9fge9mHgaAK6XJg g2IF8vywYRaDa2motBUKM+wcpJFjedmCV3IZNokcKdJXAg7Wcsb0+qAt0LZ+WlJ3xr KfA4H6I9eMCTw== Original-Received: from alfajor (unknown [216.154.27.250]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 47AF2120328; Thu, 28 May 2020 13:45:18 -0400 (EDT) In-Reply-To: <20200528110037.53f0b487@jabberwock.cb.piermont.com> (Perry E. Metzger's message of "Thu, 28 May 2020 11:00:37 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 12:24:56 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251567 Archived-At: > I would like to make it possible for a user to at least correct this > situation in their .emacs by knowing when Emacs has been invoked by > launching the .app versus when it has been invoked from the command > line (and has the proper PATH set etc.) I don't know if that can be easily detected, but you can simply try something like the following in your .emacs: (when (equal default-directory "/") (cd "~/")) > Note that in a theoretical sense such an issue probably exists on > other platforms (or might in the future) so something clean would > be good. At leas under GNU/Linux, I can't think of any reason a GUI desktop environment would use "/" as the starting directory for an application unless maybe that app is started as root. Then again, that same reasoning implies that it's braindead for macOS to do just that. I take it as an implicit statement on the part of Apple that they really intend to move towards single-user systems (as is basically the case for their iOS devices already) Stefan