如何在Emacs shell缓冲区中获得对'✖'等的支持? [英] How to get support for '✖' and the like in the Emacs shell buffer?

查看:87
本文介绍了如何在Emacs shell缓冲区中获得对'✖'等的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个进程,该进程在发生错误时会输出字符✖"(按Unicode定义).但是,如果在Emacs Shell缓冲区(GNU Emacs的Aquamacs发行版)中运行该进程,则根本看不到该错误.

I'm running a process that, on failing error, outputs the character '✖'(as defined in Unicode). However, I don't see the error at all if running the process in an Emacs shell buffer (Aquamacs distro of GNU Emacs).

在braeburn.aquamacs.org上使用2011年3月18日的GNU Emacs 23.3.1(i386-apple-darwin9.8.0,NS apple-appkit-949.54)-Aquamacs Distribution 2.2

Using: GNU Emacs 23.3.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2011-03-18 on braeburn.aquamacs.org - Aquamacs Distribution 2.2

如何获取Emacs Shell缓冲区以支持此类Unicode字符?

How to get the Emacs shell buffer to support such unicode characters?

推荐答案

要告诉单个shell缓冲区将shell的输出视为UTF-8,请发出命令 Cx RET p ,然后当询问从系统输出的编码系统:"时,键入"utf-8".然后,当问到编码系统为该过程的输入:"时,我只键入 RET ;我从不直接向外壳提供UTF-8输入.

To tell an individual shell buffer to treat the output from the shell as UTF-8, issue the command C-x RET p, and type "utf-8" when asked "Coding system for output from the process: ". When then asked "Coding-system for input to the process: ", I just type RET; I never provide UTF-8 input directly to the shell.

或者,要自动获得此行为,请将(prefer-coding-system 'utf8)放入您的.emacs文件中.实际上,这也会导致UTF-8也用于其他情况,这是大多数人可能想要的.

Alternately, to get this behavior automatically, put (prefer-coding-system 'utf8) in your .emacs file. Actually, that will cause UTF-8 to be used in some other contexts as well, which is what most people would probably want.

这篇关于如何在Emacs shell缓冲区中获得对'✖'等的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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