0

Background

The first time I run magit-status after starting Emacs, I get a series of 7 alert dialogs popping up. Each one just says "emacsclient 25.1" and has an OK button. They don't seem to do anything at all.

Nothing in the *Messages* buffer seems to relate to this.

I saw some reference in the Magit manual about needing to locate emacsclient, so I did put C:\Emacs\bin into my path.

This only happens the first time. After that, magit-status works fine without any popups at all.

Edit More information... It looks like this is coming from within Magit's with-editor-locate-emacsclient.

I just tried running that function directly. Got the same bunch of dialogs. After confirming them all (they only have "OK" buttons, so confirm it is, I guess!) I get something in *Warnings*:

Warning (with-editor): Cannot determine a suitable Emacsclient

Determining an Emacsclient executable suitable for the current Emacs instance failed. For more information please see https://github.com/magit/magit/wiki/Emacsclient. Warning (with-editor): Cannot determine a suitable Emacsclient

Determining an Emacsclient executable suitable for the current Emacs instance failed. For more information please see https://github.com/magit/magit/wiki/Emacsclient.

It looks a lot like a path problem, even though the directory that has emacsclient.exe is on my path.

System Config

  • Magit 2.10.2
  • Windows 10
  • Emacs 25.1.1
1

Solved

Magit has a library called with-editor that attempts to locate a suitable emacsclient on the host machine.

For some reason, the emacsclient.exe in Emacs 25.1 for Windows doesn't report its version to the console. Instead it pops up the dialog box I've been seeing.

See https://github.com/magit/with-editor/issues/21 for another report of the same issue.

As suggested by the maintainer of Magit, I set with-editor-emacsclient-executable to nil, but only on Windows:

(if (eq system-type 'windows-nt)
    (setq with-editor-emacsclient-executable nil))

After that, no more popups.

  • 1
    I would recommend that, instead of using nil, you manually determine the path to the emacsclient executable and use the path to that as the value. Of course the downside is that the location may change, and then things break again, but you could counter that by checking whether the path is still valid and else falling back to nil. – tarsius Mar 24 '17 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy