all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ben McGinnes <ben@adversary.org>
To: Nicolas Cavigneaux <cavigneaux@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: default-directory launched from Dock macOS
Date: Mon, 04 May 2020 02:06:54 +0000 (UTC)	[thread overview]
Message-ID: <20200504020650.a2qodziniqovws2u@adversary.org> (raw)
In-Reply-To: <m2h7x46oja.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]

On Tue, Apr 28, 2020 at 09:46:17AM +0200, Nicolas Cavigneaux wrote:
> 
> Maybe it's related to how MacOS and Spotlight handle environment
> variables when the app is launch by clicking its icon or using
> spotlight.

It could be, but OS X has been doing weird things with that for a
while, and not just with paths.

> 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/

That's an interesting solution, but there are a couple of others.

One option for use entirely within Emacs with elisp is this:

    https://github.com/purcell/exec-path-from-shell

I took a slightly different approach for launching Emacs from the Dock
that would inherit environmental variables and one or two other things
(including several, preconfigured Emacs server options), by making a
handful of these:

    https://github.com/adversary-org/emacs-launcher-osx

My solution is a bit more configurable since it's basically just
stripped down app container with just the Emacs icon and a shell
script to run a few things (like "source ~/.bashrc"), sometimes set
custom variables, and then launch Emacs.  Most of these are also set
to launch an Emacs server (with various applications configured to use
the relevant corresponding client).

Most of the time these[1] these all behave exactly as expected.


Regards,
Ben

 1. I'd say "all," but Murphy's Law dictates that it would break the
    moment I made the claim, so I won't.  😉

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      parent reply	other threads:[~2020-05-04  2:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  8:24 default-directory launched from Dock macOS Tak Kunihiro
2020-04-27 20:37 ` Perry Smith
2020-04-28  4:47 ` Tak Kunihiro
2020-04-28  7:32   ` Eli Zaretskii
2020-04-28  7:33   ` Carlo Tambuatco
2020-04-28  8:08     ` Tak Kunihiro
2020-04-28  8:24       ` 27.0.91; default-directory launched via Dock MacOS Tak Kunihiro
2020-05-03  2:52         ` bug#40924: " Tak Kunihiro
2021-01-28  6:44           ` Lars Ingebrigtsen
2021-01-28 10:02             ` Tak Kunihiro
2021-01-28 10:25               ` Lars Ingebrigtsen
2021-01-28 10:57                 ` Andrii Kolomoiets
2020-04-28  7:46   ` default-directory launched from Dock macOS Nicolas Cavigneaux
2020-04-28 12:45     ` Perry Smith
2020-04-28 13:46       ` Nicolas Cavigneaux
2020-04-28 15:51         ` Perry Smith
2020-05-04  2:06     ` Ben McGinnes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200504020650.a2qodziniqovws2u@adversary.org \
    --to=ben@adversary.org \
    --cc=cavigneaux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.