如何在Windows 10上使用X Windows与Emacs? [英] How to use X Windows with Emacs on Windows 10 Bash?

查看:559
本文介绍了如何在Windows 10上使用X Windows与Emacs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ubuntu上的Bash在Windows程序中使用Emacs for C ++。
现在,我可以使用键盘快捷键对所有内容进行编码,但是,我想使用鼠标选择文本,或者用鼠标设置标记,而不必总是使用我的键盘。

I am using the Bash on Ubuntu on Windows program to use Emacs for C++. Right now, I can code everything using the keyboard shortcuts, however, I want to select text with my mouse or set the mark with my mouse instead of always having to use my keyboard.

要获得X Windows系统,我已经做了 sudo apt-get install xserver -xorg ,但emacs仍然运行在终端编辑器中。

To get the X Windows System, I already did sudo apt-get install xserver -xorg but emacs still runs in a terminal editor.

我不知道使用什么其他命令或如何让X Windows开始运行。

I don't know what other commands to use or how to get X Windows to start running.

推荐答案

Windows bash不支持X Server。但是,使用Windows X Server端口,如MobaXTerm,XMing或vcXsrv与Windows bash配合使用。有些事情是开箱即用(gvim做的),emac需要更多的努力。

Windows bash does not support X Server. However, using a Windows X Server port such as MobaXTerm, XMing or vcXsrv in conjunction with Windows bash works. Some things work out of the box (gvim did,) emacs requires more effort.

这是我如何使之工作的:

Here's how I've made it work:


  • 安装 MobaXterm 。很可能你可以使它与XMing一起工作,但是我已经测试过MobaXterm。 更新:通过 vcXsrv XMing (付费版本)基本上是一样的,我可能会坚持使用MobaXTerm。

  • Install MobaXterm. Most probably you can make it work with XMing as well, but I have tested only with MobaXterm. Update: Tested with vcXsrv and XMing (paid version.) Works essentially the same, I will probably stick with MobaXTerm.

安装emacs 25.1快照。原因:Ubuntu 14.04带有emacs 24.3,它不适用于Windows bash和MobaXTerm X服务器(不知道为什么,它太老了。)

Install emacs 25.1 snapshot. The reason: Ubuntu 14.04 comes with emacs 24.3, which doesn't work with Windows bash and MobaXTerm X server (no idea why, and it's too old anyway.)

使用以下命令安装快照:

Install the snapshot using the following commands:

sudo add-apt-repository ppa:ubuntu-elisp/ppa
sudo apt-get update
sudo apt-get install emacs-snapshot

然后运行

sudo update-alternatives --config emacs

并选择 emacs-snapshot

确保设置 DISPLAY

export DISPLAY=localhost:0.0

运行MobaXTerm(你不需要做任何事情,只需启动它 - 它会在需要时启动X服务器。)

Run MobaXTerm (you don't need anything to do in it, just start it - it will start X Server when needed.)

在bash中运行emacs并享受。

Run emacs in bash and enjoy.

还有一个问题,我测试过的所有三个软件包(MobaXTerm,XMing和vcXsrv)仍然存在。 Emacs坚持初始帧大小,并且在窗口调整大小时不调整其帧的大小。与菜单栏相同的问题 - 当菜单栏被禁用时,emacs没有回收它的空间,它保持灰色的矩形。这个问题似乎是特殊的,在Windows上的bash - gvim和其他GUI程序似乎工作正常。另外,使用Windows上的任何X Server在Linux上运行emacs 25.1都可以正常运行。我已经尝试使用不同的GUI设置(GTK 2.0等)构建emacs,但是在Windows bash上的emacs被卡住了。如果我找到一个解决方法,我会发布更新。

One problem remains, and it persists across all three packages I've tested (MobaXTerm, XMing and vcXsrv). Emacs sticks to the initial frame size, and doesn't resize its frame when the window is resized. Same problem with the menu bar - when menu bar is disabled, emacs doesn't reclaim its space, it remains as a grey rectangle. This problem seems to be peculiar to emacs on Windows bash - gvim and other GUI programs seem to work fine. Also, running emacs 25.1 on Linux using any X Server on Windows works fine. I have tried to build emacs with different GUI settings (GTK 2.0 etc.) but emacs make on Windows bash gets stuck. If I find a workaround for this I will post an update.

这篇关于如何在Windows 10上使用X Windows与Emacs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆