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

Is it possible to make the 'emacs' shell command open in the current instance ? #19

Closed
deb0ch opened this issue Jan 9, 2017 · 5 comments

Comments

@deb0ch
Copy link

deb0ch commented Jan 9, 2017

I would like that when I use commands such as emacs, ne or emacsclient from an Emacs terminal, Emacs opens the file in the current Emacs instance.

Is it possible using with-editor ?

If not at the moment, is it something that would be possible to implement ?

@tarsius
Copy link
Member

tarsius commented Jan 9, 2017

That's what emacsclient file is supposed to do, even without with-editor. If that doesn't work for you, then that probably means that you didn't start the server in the running emacs instance.

@deb0ch
Copy link
Author

deb0ch commented Jan 9, 2017

emacsclient kind of does it, but if I have several instances it will always choose another one.

I wonder if there is a way to make it work seamlessly for ne and emacs commands though.

@tarsius
Copy link
Member

tarsius commented Jan 9, 2017

I don't know what ne is, some wrapper script I suppose? But for emacs the answer is no, that always starts a new instance. As for emacsclient always choosing another instance: I think it always uses the instance which uses the default socket (and that's always under the control of the first instance you started). But really I don't use emacsclient except for committing with magit/with-editor, so you should ask elsewhere for help.

And to answer your original question: no, with-editor cannot help with this scenario, or be made to do so. I suspect that you will end up having to write a shell-script which wraps emacs and emacsclient. I once wrote one, but I am afraid I lost it. But there most be others in the wild.

@deb0ch
Copy link
Author

deb0ch commented Jan 9, 2017

Ok, thank you so much for your insights, that was really helpful ! 👍

I thought for the longest time that with-editor could help me with that, but I guess I never dug deep enough to realize that no.

Well, I guess I'll see you around ! Take care and thank you for the awesome Magit !

@tarsius
Copy link
Member

tarsius commented Jan 9, 2017

Your welcome!

@tarsius tarsius closed this as completed Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants