分页: 1 / 1

[分享]emacs21中文粘贴的简单解决办法

发表于 : 2007-02-25 19:30
huayanghao
emacs21中文粘贴似乎一直以来都不太好解决.如果换到emacs23,因为还是不稳定版本,把文件搞丢了就不好玩了.
我也试过好多种方法,后来在网上无意间发现有一种很简单却很好用的方法.据说这是某人从redhat9下的emacs配置
文件中拷过来的.看来在技术细节上,ubuntu还要继续努力.
把下面几行加到.emacs中去就行了:

代码: 全选

(when window-system
;; enable wheelmouse support by default
(mwheel-install)
;; use extended compound-text coding for X clipboard
(set-selection-coding-system 'compound-text-with-extensions))
其它的相关设置是:

代码: 全选

(set-language-environment 'Chinese-GB)
(set-keyboard-coding-system 'euc-cn)
(setq x-select-enable-clipboard t) 
(set-clipboard-coding-system 'euc-cn)
(set-terminal-coding-system 'euc-cn)
(set-buffer-file-coding-system 'euc-cn)
(set-selection-coding-system 'cn-gb-2312)
我的LOCALE是

代码: 全选

LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh:en_US:en
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

发表于 : 2007-02-25 19:59
bones7456
呵呵,搞不懂一个粘贴功能都需要这么配置的编辑器有何用(个人意见 ....呵呵。)

发表于 : 2007-02-25 21:47
millenniumdark
emacs 23用了快半年了,一直很稳定,没丢过文件。

发表于 : 2007-02-25 22:32
huangjiahua
emacs23 xft 版本非常好