Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Options to link emacsclient to app? #9

Closed
LukeXuan opened this issue Oct 29, 2016 · 14 comments
Closed

[Feature] Options to link emacsclient to app? #9

LukeXuan opened this issue Oct 29, 2016 · 14 comments

Comments

@LukeXuan
Copy link

As described, it would be grateful to link emacsclient to app, since the sartup of spacemacs cost some time and it would be better if started as daemon.

@d12frosted
Copy link
Owner

Hey @LukeXuan ,

Do you want to have emacsclient under Emacs.app/Contents/MacOS directory? Could you please help me understand what benefits it brings? 😸

@d12frosted
Copy link
Owner

@LukeXuan ping? 😸

@LukeXuan
Copy link
Author

LukeXuan commented Nov 5, 2016

I'm sorry that I got some misunderstanding about the functionality of emacsclient, and I achieve my purpose with some other methods.

Originally I want emacs started as daemon when I started OS X, and open a new frame connecting to it when I open Emacs.app.

@dustinswan
Copy link

@LukeXuan Did you get this working with emacs-plus? I'm trying to do this as well.

@LukeXuan
Copy link
Author

@dustinswan After some research I figure out that the emacsclient just "wake up" the emacs process to bring a frame to the front. So there still exists some problem such as when I close this frame (command+w) the logo of emacs on the dash won't disappear.

I mainly borrow codes and ideas from this gist and its forks. You may also find something helpful.

@LukeXuan
Copy link
Author

@d12frosted So I now suggest that one should tweak this emacs version so that the icon on the dash will disappear when there is no GUI (frame) in the front? That would be perfect and I didn't find any solution now. Also it should be possible since some app such as Alfred2 achieve this (remain running in the background, show the icons only when I open the preference).

@dustinswan
Copy link

dustinswan commented Nov 14, 2016

@LukeXuan Thanks, creating an Apple Script app that runs /usr/local/bin/emacsclient actually works pretty well!

@d12frosted
Copy link
Owner

Hey @LukeXuan. So what is needed to be done from emacs-plus side?

@LukeXuan
Copy link
Author

LukeXuan commented Jan 3, 2017

@d12frosted I'm not familiar with native cocoa development. But some search suggests that TransformProcessType helps. However this should be implemented in emacs but not this package:( I thinks there's nothing to be done now.

@d12frosted
Copy link
Owner

Ok, let me know if something is needed from me 😸 Closing this issue for now.

@gnzlbg
Copy link

gnzlbg commented Apr 5, 2020

I'm wasting a lot of time trying to get this to work.

When installing emacs-plus via homebrew, one can just write brew service start emacs to start an "emacs service" on startup - I haven't find any documentation about what this means, but I suspect this starts an emacs --daemon on startup even though I don't see it with ps.

Ideally, emacs-plus would provide an App that would just run emacsclient to connect to this emacs --daemon instance.

Could you please help me understand what benefits it brings?

The benefit is that emacs starts instantaneously from everywhere, and all emacs share all buffers and state. The only time emacs starts "slowly" is during system startup, where emacs is started in the background.

E.g. if you git commit, a new client instantaneously starts in your shell, that has access to all buffers from all emacs instances anywhere.

Setting this up in linux takes 1 minute. Setting this up in OSX has taken me hours.

Ideally, this should be as simple as:

brew install emacs-plus
brew service start emacs
ln -sf /usr/local/emacsclient.app /Applications

@d12frosted
Copy link
Owner

@gnzlbg wow, it's a pity that you have to waste so much time.

The benefit is that emacs starts instantaneously from everywhere, and all emacs share all buffers and state. The only time emacs starts "slowly" is during system startup, where emacs is started in the background.

Ah, I actually though that the request was to put emacsclient under Emacs.app alongside with emacs executable. That's why I asked what benefit it brings :) I understand how emacsclient can be useful in general.

But let me understand your use-case better. Because right now I don't see how EmacsClient.app would help you. If you are running git commit from terminal (correct me if I am wrong), all you need to do is to properly set your editor to emacsclient. Maybe you need to use -c option (to spawn new frame) or -nw (to use terminal window).

Though in general, I see how people could benefit from emacsclient.app (so they can run it from finder/search/dock).

@Mariownyou
Copy link

How do I link emacs after installation, I can't see it in my apps, but it opens from terminal

@sethidden
Copy link

Instructions how to create EmacsClient.app yourself using macOS Automator: https://stackoverflow.com/a/39907215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants