微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Magit无法连接到docker内的emacsclient?

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

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

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

/usr/bin/emacsclient.emacs24 --socket-name=/root/.emacs.d/server/server tmp.make
/usr/bin/emacsclient.emacs24: connect: Connection refused
/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问题?

emacs --daemon                                                                         

 Warning: due to a long standing Gtk+ bug                                               
 http://bugzilla.gnome.org/show_bug.cgi?id=85715                                        
 Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. 
 Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.      
 Loading 00debian-vars...                                                               
 Loading 00debian-vars...done                                                           
 Loading /etc/emacs/site-start.d/50cmake-data.el (source)...                            
 Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done                        
 Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...                   
 Loading debian-ispell...                                                               
 Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...           
 Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done       
 Loading debian-ispell...done                                                           
 Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...             
 Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done         
 Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done               
 Loading /root/.emacs.d/init_func.el (source)...                                        
 Loading /root/.emacs.d/init_func.el (source)...done                                    
 Loading flymake...                                                                     
 Loading flymake...done                                                                 
 Loading company...                                                                     
 Loading company...done                                                                 
 Loading linum...                                                                       
 Loading linum...done                                                                   
 [yas] Prepared just-in-time loading of snippets successfully.                          
 Loading /root/.emacs.d/recentf...                                                      
 Loading /root/.emacs.d/recentf...done                                                  
 Cleaning up the recentf list...                                                        
 Cleaning up the recentf list...done (0 removed)                                        
 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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


本篇文章和大家了解一下docker容器无法执行vim如何解决。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。目录docker容器无法执行vim【已解决...
这篇文章主要介绍了windowsDockerDeskTop最新款4.18.0怎么安装的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇windows&nb...
这篇文章主要介绍“docker的常用命令怎么使用”,在日常操作中,相信很多人在docker的常用命令怎么使用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操...
这篇文章主要介绍“docker中怎么配置hosts”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“docker中怎么配置hosts”...
这篇“docker怎么部署zookeeper集群”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读...
这篇文章主要介绍了怎么使用Maven打包构建Docker镜像并推送到仓库的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇怎么使用Maven...
本文小编为大家详细介绍“怎么使用Docker自动搭建GitLab”,内容详细,步骤清晰,细节处理妥当,希望这篇“怎么使用Docker自动搭建GitLab”文章能帮助大家解决疑...
这篇文章主要介绍“docker容器内缺少命令如何解决”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“docker容器内缺少...
本篇内容主要讲解“DockerAPI未授权访问漏洞问题怎么解决”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习...
今天小编给大家分享一下怎么使用docker部署centos系统测试环境的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家...