From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Nicolas Cavigneaux Newsgroups: gmane.emacs.help Subject: Re: default-directory launched from Dock macOS Date: Tue, 28 Apr 2020 15:46:55 +0200 Message-ID: References: <20200427.172441.848202153844253762.tak.kunihiro@gmail.com> <20200428.134710.626410507196052586.tak.kunihiro@gmail.com> <01E79805-D950-4876-BF92-CB0F2FEA36CA@easesoftware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="6323"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:wWtgl/IG2YIkPSRwQAYaF4gRPDo= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 28 15:53:44 2020 Return-path: Envelope-to: geh-help-gnu-emacs@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 1jTQgB-0001Yb-Aj for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 15:53:43 +0200 Original-Received: from localhost ([::1]:58666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTQgA-0004bD-9i for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 09:53:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38062) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTQbc-0003gE-CV for help-gnu-emacs@gnu.org; Tue, 28 Apr 2020 09:53:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTQZk-0006Aj-DL for help-gnu-emacs@gnu.org; Tue, 28 Apr 2020 09:49:00 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:49368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jTQZj-0005zP-VR for help-gnu-emacs@gnu.org; Tue, 28 Apr 2020 09:47:04 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jTQZg-000Rez-RD for help-gnu-emacs@gnu.org; Tue, 28 Apr 2020 15:47:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=159.69.161.202; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/28 08:28:38 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122966 Archived-At: Perry Smith writes: >> On Apr 28, 2020, at 2:46 AM, Nicolas Cavigneaux wrote: >> >> Tak Kunihiro writes: >> >>> From: 조성빈 >>> Subject: Re: default-directory launched from Dock macOS >>> Date: Tue, 28 Apr 2020 08:37:33 +0900 >>> >>>>> I want to launch emacs from Dock on macOS. >>>>> >>>>> From scratch buffer on emacs 26.3, C-x C-f prompts home directory >>>>> "~/". However, from scratch buffer on emacs 27.0.91, C-x C-f prompts >>>>> root directory "/", which is inconvenient. >>> >>>> I also noticed this - I launch Emacs from spotlight, and it’s pretty >>>> inconvenient. Can anybody explain why the change happened? >>>> Was it explicit? >>> >>> It's good to know I'm not the only one. >> >> Maybe it's related to how MacOS and Spotlight handle environment >> variables when the app is launch by clicking its icon or using >> spotlight. >> >> There are good chance that your HOME environment variable is empty. >> >> You can instruct MacOS about these environment variables by following a >> post I wrote about it: >> >> https://www.bounga.org/tips/2020/04/07/instructs-mac-os-gui-apps-about-path-environment-variable/ >> >> Hope this helps. > > This sounded plausible but HOME is set to my HOME directory and USER is set to my user name. In your shell or in launchd? Launchd is responsible for the environment variables your GUI apps (launched by clicking their icon or using Spotlight) have access to. > It will be curious to learn what changed. If my theory is right, previous Emacs versions were doing some black magic to find your home even if the HOME environment variable wasn't set and new version doesn't try anymore and defaults to "/". -- Nicolas Cavigneaux http://www.bounga.org http://www.cavigneaux.net