Tag: emacs

全局改变编译命令

我使用Emacs与Docker进行开发。 Emacs在主机上运行一个包含代码的容器,在Docker容器内执行,testing等等。 我开始编辑一些Emacs模式并添加variables,以允许docker作为命令前缀。 因此,使用.dir-locals我可以在Docker容器中运行类似rspec命令。 但是我必须改变rspec-mode的代码才能到达那里。 我见过的所有模式都有共同点,那就是使用Emacs的compilefunction来运行它们的命令。 所以我想知道是否有机会全局扩展compile函数或者comint中的任何东西来添加一个前缀来运行通过Docker内部编译启动的每个外部命令。 例如rspec将被转换为docker-compose exec app rspec 。 理想情况下,这将在一个.dir-locals来完成,以允许项目特定的前缀。 这将导致一个更通用的解决scheme,它应该适用于任何模式而无需更改其代码。 它不会受限于Docker,而是支持任何环境,其中一些模式需要一个特殊的前缀到他们的命令。 不幸的是,我不知道如何得到这样的东西。

愚蠢的terminal在非互动docker

我有一个在非交互式泊坞窗容器中运行的CI脚本。 我使用的一个应用程序(批处理模式下的emacs)需要一个TTY,即使它永远不会读取它。 在交互模式下,我可以将/dev/tty传递给应用程序,但是在非交互模式下,设备甚至不存在! 如何在非交互式docker集装箱中创build假docker? 顺便说一句,我没有控制启动脚本的CI亚军(无人机)…所以我不能添加-i或-t 运行ls -R /dev给出 /dev: fd full fuse kcore mqueue null ptmx pts random shm stderr stdin stdout tty urandom zero /dev/mqueue: /dev/pts: ptmx /dev/shm:

docker运行从脚本分离,而不杀死容器

我有一个包含这一行的脚本: fgrep -m 1 'PostgreSQL init process complete' <( docker run –name test-postgres-migration \ -a STDOUT -p 5432:5432 postgres:9.4 ) 但是,即使我将其更改为: fgrep -m 1 'PostgreSQL init process complete' <( docker run –name test-postgres-migration \ -a STDOUT -p 5432:5432 postgres:9.4 </dev/null ) 要么: fgrep -m 1 'PostgreSQL init process complete' <( docker run –name test-postgres-migration \ […]

如何将Emacs的Elpy in-buffer python解释器连接到docker容器?

我正在开始一个将在Docker容器中运行的Django应用程序。 我希望能够在Emacs中使用交互式Python ,在Docker容器和Django应用程序的上下文中执行代码。 基本上我想要Emacs使用的Python解释器在Docker容器中运行。 我已经设法达到这一点,大部分是通过创build一个修改的Dockerfile,它只是不同于我的实际Dockerfile容器,而不是调用它结束的Django命令: CMD ./manage.py shell 这意味着当我运行该Docker容器时,我得到了一个实际在容器中运行的Django解释器。 我有Elpy调用这个时启动一个python shell通过添加: (setq python-shell-interpreter "/path_to_my_script/run_shell.sh") 到我的.emacs.d / init.el文件。 其中“/path_to_my_script/run_shell.sh”脚本是运行容器的脚本。 这实际上是大部分工作。 我可以突出显示一行代码,如 from django.utils import timezone 并运行Emacs命令elpy-shell-send-region-or-buffer并执行代码。 我可以突出显示 print(timezone.now()) 它会打印当前时间。 我已经validation,这个代码实际上是运行在我的容器上运行: import os print(os.getcwd()) 并看到我的Docker容器的用户的主目录。 我仍然使用这个设置的问题是当我尝试使用相同的elpy-shell-send-region-or-buffer命令同时执行多行python时。 当我突出显示多行并执行该命令时,在python shell中出现以下错误: Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python3.5/codecs.py", line 895, in open file = […]

如何在Docker Hub中从源代码构buildEmacs? BSS和堆之间的差距

直到最近,我已经能够使用这个配方在Docker容器中从源代码构buildemacs。 不过截至上周,我所有的构build都失败了 Warning: Your system has a gap between BSS and the heap (32188607 bytes). This usually means that exec-shield or something similar is in effect. The dump may fail because of this. See the section about exec-shield in etc/PROBLEMS for more information. 我读过etc / PROBLEMS ,这对我没有任何意义。 是否有人知道如何解释这个docker集装箱和我可以做什么来在hub.docker.com再次构buildemacs? 我试过了 cat 0 > /proc/sys/kernel/exec-shield 但我不认为这是真正的问题,它不存在于容器中。 交叉发布到https://emacs.stackexchange.com/questions/22665 […]

Docker化emacs不加载扩展

我正在尝试在受到关于该主题的出色博客文章的启发后,对一些GUI应用程序进行Docker化。 我正在努力让spacemacs启动并运行,因为spacemacs非常棒。 但由于某种原因,Docker似乎并没有像预期的那样克隆spacemacs回购。 我的Dockerfile是: # Run spacemacs in a contianer # # sudo docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY garry-cairns/spacemacs # FROM ubuntu:14.04 MAINTAINER Garry Cairns ENV REFRESHED_AT 2015-06-29 # get base components RUN ["apt-get", "-y", "install", "emacs", "git"] # move into our working directory # ADD must be after chown see http://stackoverflow.com/a/26145444/1281947 RUN […]

在Emacs的Docker容器上运行命令

我正在使用emacs(spacemacs),我使用docker进行开发。 我如何从emacs运行我的testing? 就像我做terminaldocker-compose run web rspec或任何命令。

在Docker容器中运行emacs

我正在使用Mac并想在Docker容器中运行emacs。 有没有一个首选的方法来解决这个问题? 在我的stream程中,我得到了stuc,因为DISPLAY / TERM没有设置 > docker exec -it c6a7a76db84c bash > sudo apt-get install emacs … > oot@c6a7a76db84c:/var/log/apache2# emacs Please set the environment variable DISPLAY or TERM (see `tset'). > oot@c6a7a76db84c:/var/log/apache2# tset tset: unknown terminal type unknown Terminal type? 我应该用什么tset? 还是有一个首选的方式来运行Docker容器中的emacs?