help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: default-directory launched from Dock macOS


From: Nicolas Cavigneaux
Subject: Re: default-directory launched from Dock macOS
Date: Tue, 28 Apr 2020 15:46:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin)

Perry Smith <pedz@easesoftware.com> writes:

>> On Apr 28, 2020, at 2:46 AM, Nicolas Cavigneaux <cavigneaux@gmail.com> wrote:
>> 
>> Tak Kunihiro <tak.kunihiro@gmail.com> writes:
>> 
>>> From: 조성빈 <pcr910303@icloud.com>
>>> 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




reply via email to

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