-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
emacs-30: provide Emacs Client.app #783
base: master
Are you sure you want to change the base?
Conversation
It works, but I can't figure out how to capture file path when you open a file from Finder. If someone knows - please let me know :) |
Ok, shell scripts is not the right approach as it seems. Turns out macos sends filename via system events, not via arguments. Will explore two directions - a simple cocoa application or a simple apple script application. |
if you create a AppleScript or automator app it works fine. I am using it this way. |
unfortunately brew services does not run the daemon. I guess it's just keeping emacs alive? which six of one half dozen of the other I guess. I guess emacs is looking for the daemon to run in client mode? so maybe it doesn't know what's going on with this service that's just keeping emacs running? |
I'm curious about what this is for? If the idea is to support opening files via finder interactions or via If it's to support opening via org-capture, isn't that better done in the existing Emacs.app, ie issue #285 . Or is it to have an app to call that can ensure the main Emacs is alive and route file args to it? In my current workflow, restarting Emacs looks like Once that's up, I can treat the Emacs.app like most other apps using activation/open/drag files etc. It'd be nice to have stop/start/restart/daemon handling less of a thing I need to worry about, as depending on the timing I can end up with extra processes, or a foreground daemon app instead. I think ideally the one Emacs.app would act as the app to:
Is there benefit to handling these cases in different applications, or is it more about what's feasible? |
@danielboston38 I'm running emacs-plus via
|
Any proof? I just did it and it works. Keep in mind that TCP is not supported (not sure why).
Yes, but every user needs to create it. Wouldn't it be nice if we had it OOTB?
To have ability to open files from Finder in Emacs Client. And I just realised that you are correct for cases when Emacs is already open, because Finder doesn't create a new instance of Emacs. But if you start Emacs server via brew, then things break. When I try to open a file in Emacs via Finder when the service is running, Emacs is opened, but the window is not created 🤷 So I actually have to use CLI to open a new window. And maybe this is what needs to be fixed actually. @mbhutton thanks a lot for your insights! 🙏 |
True! Activation and file opening via Finder work well when the service is running and at least one frame is active. But when there's no active frame then usually something surprising happens like an extra process, or no window opening, and I need to figure out what went wrong and fix it. It would be amazing to have an app, Emacs.app itself or a companion app, "do what I mean", for activation, finder files, and org-protocol. My dream would be for it to:
A tool that was able to do all that would also be just as useful from the command line.
|
Maybe there are some extractable, composable commands in there that could be useful as their own command. Eg:
Btw I know this is crazy out of scope for this PR (!), just trying to capture what the scope of the problem is. Kinda sounds like a project in itself to cover all the above. |
Oh and (to add to the list of wishes!) ideally the app would also act as a share target to invoke the command org-protocol convention of url, title, and text. If all of that aligns with what most users want, I could definitely contribute, or possibly write it directly in a different project, as it could potentially be useful across all the macOS Emacs flavours. I think that solving all those problems probably does require one tool that's able to coordinate all those aspects, otherwise it's easy to end up with a patchwork of apps/tools that only work in some cases. |
this is mostly for testing
if it goes well, I will provide Emacs Client.app for other versions of Emacs.