Magit无法连接到docker内的emacsclient?

前端之家收集整理的这篇文章主要介绍了Magit无法连接到docker内的emacsclient?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我在docker中运行emacs24.5.1(基本映像是Ubuntu).我通过apt-get安装了emacs.此外,我通过melpa(magit version magit-20170702.858)安装了magit,它很棒.但是,当我尝试提交某些内容时,magit会遇到以下错误

  1. 1 git ? commit --
  2. /usr/bin/emacsclient.emacs24: connect: Connection refused
  3. /usr/bin/emacsclient.emacs24: error executing alternate editor
  4. "sh -c 'echo "WITH-EDITOR: $$OPEN $0"; sleep 604800 & sleep=$!; trap "kill $sleep; exit 0" USR1; trap "kill $sleep; exit 1" USR2; wait $sleep'"
  5. error: There was a problem with the editor
  6. '/usr/bin/emacsclient.emacs24 --socket-name=/root/.emacs.d/server/server'.
  7. Please supply the message using either -m or -F option.

当我尝试手动启动emacsclient时,emacsclient有错误

  1. /usr/bin/emacsclient.emacs24 --socket-name=/root/.emacs.d/server/server tmp.make
  2. /usr/bin/emacsclient.emacs24: connect: Connection refused
  3. /usr/bin/emacsclient.emacs24: error accessing socket "/root/.emacs.d/server/server"

这表明它不是真正的magit错误,而是emacsclient错误,而且它可能正在发生,因为我在docker中运行,虽然我不确定.

有没有人知道如何启动emacsclient或绕过magit内部的emacsclient的要求.曾经有一个插件模式绕过magit内部的emacsclient,但是不久之前已经弃用并从melpa中删除了,所以我不太热衷于尝试它.

UPDATE
emacs –daemon在docker中没有问题,但magit提交仍然无法工作所以也许它毕竟不是一个docker问题?

  1. emacs --daemon
  2. Warning: due to a long standing Gtk+ bug
  3. http://bugzilla.gnome.org/show_bug.cgi?id=85715
  4. Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
  5. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
  6. Loading 00debian-vars...
  7. Loading 00debian-vars...done
  8. Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
  9. Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done
  10. Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
  11. Loading debian-ispell...
  12. Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
  13. Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
  14. Loading debian-ispell...done
  15. Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
  16. Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
  17. Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
  18. Loading /root/.emacs.d/init_func.el (source)...
  19. Loading /root/.emacs.d/init_func.el (source)...done
  20. Loading flymake...
  21. Loading flymake...done
  22. Loading company...
  23. Loading company...done
  24. Loading linum...
  25. Loading linum...done
  26. [yas] Prepared just-in-time loading of snippets successfully.
  27. Loading /root/.emacs.d/recentf...
  28. Loading /root/.emacs.d/recentf...done
  29. Cleaning up the recentf list...
  30. Cleaning up the recentf list...done (0 removed)
  31. Starting Emacs daemon.
最佳答案
仔细检查您的基本映像:this thread报告看到相同的错误消息:

I managed to figure out the problem. I had byte compiled the emacs
code with emacs24,and loading that in emacs23 caused all heck to break
loose.
With the byte compilation done with a matching version of emacs,
the test suite passes.

various distro(包括Ubuntu 16.04)可以使用emacs find here an example of building a docker image.
Emacs(23,用你的版本替换)is installed as

  1. export DEBIAN_FRONTEND=noninteractive
  2. test $1 = 7.11 && emacs=emacs23-nox || emacs=emacs-nox
  3. apt-get update
  4. apt-get install -y -q build-essential git \
  5. libxapian-dev libgmime-2.6-dev libtalloc-dev \
  6. zlib1g-dev python-sphinx man dtach $emacs gdb gpgsm
  7. apt-get -y autoremove
  8. apt-get -y clean
  9. rm -rf /var/lib/apt/lists/

猜你在找的Docker相关文章