;;允许emacs和外部其他程序的粘贴
(setq x-select-enable-clipboard t)
加到.emacs
可以复制到外面
关于EMACS使用的两个问题
- forrest
- 帖子: 36
- 注册时间: 2005-11-13 1:51
- 联系:
以下 .emacs 是我跟据 http://linux.hiweed.com/node/1391 的文章《Debian下使用GNU Emacs》修改了一下得来的,经试用发现OK,向原作者致谢!
;;-------------------------中文设定--------------------------
;; Setup GBK environment
(set-terminal-coding-system 'euc-cn)
(set-keyboard-coding-system 'euc-cn)
(set-language-environment 'Chinese-GB)
(setq locale-coding-system 'utf-8)
(setq current-language-environment "Chinese-GBK")
(prefer-coding-system 'utf-8)
;;-------------------------向其他X程序粘贴中文---------------
(when (fboundp 'utf-translate-cjk-mode)
;; Load modified utf-translate-cjk-mode
(require 'gbk-utf-mode)
;; Turn on utf-translate-cjk-mode
(utf-translate-cjk-mode 1)
;; Setup X selection for unicode encoding
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)))
;;-------------------------语法加亮--------------------------
(global-font-lock-mode 't)
;;-------------------------关闭错误提示的Beep音--------------
(setq visible-bell t)
;;-------------------------关闭启动时的`开机画面'------------
(setq inhibit-startup-message t)
;;-------------------------显示列号--------------------------
(setq column-number-mode t)
;;-------------------------括号匹配--------------------------
;;括号匹配时显示另一端的括号,而不是跳过去
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;;-------------------------标题拦显示buffer的名字------------
(setq frame-title-format "emacs@%b")
;;-------------------------Shell 使用 ansi color-------------
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;;-------------------------使用Win下的选择习惯---------------
;;用shift+方向键进行选择
(pc-selection-mode)
.
.
.
;;-------------------------中文设定--------------------------
;; Setup GBK environment
(set-terminal-coding-system 'euc-cn)
(set-keyboard-coding-system 'euc-cn)
(set-language-environment 'Chinese-GB)
(setq locale-coding-system 'utf-8)
(setq current-language-environment "Chinese-GBK")
(prefer-coding-system 'utf-8)
;;-------------------------向其他X程序粘贴中文---------------
(when (fboundp 'utf-translate-cjk-mode)
;; Load modified utf-translate-cjk-mode
(require 'gbk-utf-mode)
;; Turn on utf-translate-cjk-mode
(utf-translate-cjk-mode 1)
;; Setup X selection for unicode encoding
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)))
;;-------------------------语法加亮--------------------------
(global-font-lock-mode 't)
;;-------------------------关闭错误提示的Beep音--------------
(setq visible-bell t)
;;-------------------------关闭启动时的`开机画面'------------
(setq inhibit-startup-message t)
;;-------------------------显示列号--------------------------
(setq column-number-mode t)
;;-------------------------括号匹配--------------------------
;;括号匹配时显示另一端的括号,而不是跳过去
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;;-------------------------标题拦显示buffer的名字------------
(setq frame-title-format "emacs@%b")
;;-------------------------Shell 使用 ansi color-------------
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;;-------------------------使用Win下的选择习惯---------------
;;用shift+方向键进行选择
(pc-selection-mode)
.
.
.
Stupid is as stupid does.
AMD Sempron 2500+ 64-bits
Asrock K8NF4G-SATA2 (GeForce6100+nForce 410 chipsets)
AMD Sempron 2500+ 64-bits
Asrock K8NF4G-SATA2 (GeForce6100+nForce 410 chipsets)
- mcxbs
- 帖子: 12
- 注册时间: 2011-09-20 6:03
Re: 关于EMACS使用的两个问题
同样遇到了类似的拷贝乱码问题,最后修改成下面这样,暂时解决了^_^
代码: 全选
;; set the default text coding system
(setq default-buffer-file-coding-system 'utf-8)
;; locale coding
(setq locale-coding-system'utf-8)
(prefer-coding-system'utf-8)
(set-keyboard-coding-system'utf-8)
(set-terminal-coding-system'utf-8)
(set-selection-coding-system'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
;; 允许emacs和外部其他程序的粘贴
(setq x-select-enable-clipboard t)
-请不要相信该帐号发布的任何内容否则后果自负-