how to invoke emacsclient

Bill Cole macportsusers-20171215 at billmail.scconsult.com
Thu Oct 17 17:59:21 UTC 2024


On 2024-10-17 at 13:04:54 UTC-0400 (Thu, 17 Oct 2024 10:04:54 -0700)
Alan Bram <alan.bram at cornell.edu>
is rumored to have said:

> I have installed the emacs-app port. I see that it puts all of its 
> content
> under the /Applications/MacPorts/Emacs.app/Contents folder, including 
> the
> "emacsclient" and other command-line utilities under
> /Applications/MacPorts/Emacs.app/Contents/MacOS/bin/.
>
> If I want to use emacsclient as my EDITOR environment variable, should 
> I
> add that (long) bin directory to my $PATH setting? or maybe put the 
> entire
> long path to the utility as the value of the EDITOR variable?
>
> Should the installation of the emacs-app port automatically add that
> directory to my $PATH?
>
> Naively, it seems a little strange to me that I should have to mess 
> with
> such detail.

To launch any GUI app in macOS, you need to execute the binary at 
/path/to/app/AppName.app/Contents/MacOS/AppName  OR use  "open 
/path/to/app/AppName.app". Both mechanisms only work if the caller is 
part of the same LaunchD "domain" as the current console user.

So yes, if you want to launch an app from the command line, the whole 
path to the binary inside the app bundle 
(AppName.app/Contents/MacOS/AppName) is required. If there are many 
useful binaries in that directory, you may find it convenient to add the 
directory to your PATH environment variable, OR you could add ~/bin/ to 
your $PATH and populate ~/bin/ with symlinks to the app binaries from 
wherever that you frequently want to use from the command line.


-- 
Bill Cole
bill at scconsult.com or billcole at apache.org
(AKA @grumpybozo at toad.social and many *@billmail.scconsult.com 
addresses)
Not Currently Available For Hire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20241017/b49d9c84/attachment.htm>


More information about the macports-users mailing list