smazga / conkeror_mac_bundler

Create a Mac AppBundle for Conkeror, the "keyboard-oriented, highly-customizable, highly-extensible web browser".
11 stars 5 forks source link

external editing doesn't work #7

Closed LdBeth closed 7 years ago

LdBeth commented 7 years ago

When Conkeror is opened from GUI and run_external_editor_function or run_external_editor_functionis set to emacsclient, emacsclient cannot find the sever. But when Conkeror is invoked by Applications/Conkeror.app/Contents/MacOS/xulrunner_launcher, emacsclient can find the sever and open the file correctly.

I think it is caused by the environment variables, or some other reasons, but I have no idea about how to solve the problem.

LdBeth commented 7 years ago

https://www.emacswiki.org/emacs/EmacsClient#toc43

I find something related to this problem, and it finally works!

LdBeth commented 7 years ago

Well, the solution (see below) in EmacsWiki is not perfect since some other packages such as magit would be affected.

(setq server-socket-dir (format "/tmp/emacs%d" (user-uid)))

A little bit more perfect is set editor_shell_command to the value of with-editor-emacsclient-executable. For me, It is something like /private/var/folders/h6/9g_dxxxxxxxxxxxx0gn/T/AppTranslocation/1XXXXXXX5DF0C/d/Emacs.app/Contents/MacOS/bin/emacsclient.

But it cannot permanently get work.

LdBeth commented 7 years ago
editor_shell_command = "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -c -s ${TMPDIR}emacs${UID}/server"