Question

I've been using Magit for awhile, and when committing, it used to simply split the window and allow me to commit from within the same emacs session, but I seem to have changed this behavior to the following:

Now, when I commit my staged changes, a new emacs client starts up, taking awhile to load, finally letting me write my commit message. I then run C-c C-c to commit. The commit goes through when I close this client.

How do I force magit to run the commit within the same session of emacs and NOT open a whole new client?

enter image description here

Était-ce utile?

La solution

This bug is noted (but not solved) as a github issue here: https://github.com/magit/magit/issues/862

I think the issue here is that magit is calling 'emacsclient', which by default is /usr/bin/emacsclient. It needs to call the emacsclient that is packaged with emacs in order to work properly - other emacsclients (from homebrew, macports, etc) won't know how to connect. Normally most of us take care of this with an alias or environment variable in our shell startup scripts. However, when you run emacs.app outside of a shell it won't see these. I was able to get git-commit-mode to work properly by adding this to my init.el:

(set-variable 'magit-emacsclient-executable "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient")

I'm using an EmacsForMacOSX build, 24.3. This worked for me, hopefully it fixes it for you as well.

Autres conseils

We have recently made some major changes to magit. The commit mode has greatly changed and has created a lot of quirks. The problems currently investigated, as well as the current known fixes are listed in the Known Issues of the repository. Your issue is one of them.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top