Chinaunix首页 | 论坛 | 博客
  • 博客访问: 581817
  • 博文数量: 208
  • 博客积分: 3286
  • 博客等级: 中校
  • 技术积分: 1780
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-24 20:38
文章分类

全部博文(208)

文章存档

2012年(7)

2011年(28)

2010年(21)

2009年(76)

2008年(65)

2007年(11)

我的朋友

分类: WINDOWS

2012-01-14 18:19:41

Emacs是个非常强大的文本编辑器,不仅开源而且免费。可是下载下来的Windows版Emacs没有安装包,使用时需要到先打开Emacs再打开要编辑的文本文件,感觉不太方便。相信很多人一定希望能把Emacs像Editplus一样集成到Windows右键,点击一个文件选择“使用Emacs打开”,那样多方便啊。

没关系,我们可以自己DIY,将Emacs集成到Windows右键只是小case,只需几步就搞定。

一、新建一个文本文件,将后缀名改为.reg。

二、将下面文字写入文件中(当然,路径神马的得先更新一下)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\openwemacs]
@=”&Edit with Emacs”
[HKEY_CLASSES_ROOT\*\shell\openwemacs\command]
@=”Absolute\\Path\\to\\your\\emacs\\bin\\runemacs.exe \”%1\”"
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs]
@=”Edit &with Emacs”
[HKEY_CLASSES_ROOT\Directory\shell\openwemacs\command]
@=”Absolute\\Path\\to\\your\\emacs\\bin\\runemacs.exe \”%1\”"

三、双击.reg文件导入注册表。




注册表文件可以写成如下

[HKEY_CLASSES_ROOT\*\Shell\Open With Emacs\command] @="D:\\emacs-23.3\\bin\\emacsclientw.exe %0"

而且必须添加两个环境变量:
EMACS_SERVER_FILE 与 ALTERNATE_EDITOR环境变量
EMACS_SERVER_FILE = d:\emacs\home\.emacs.d\server\server
ALTERNATE_EDITOR = d:\emacs\bin\runemacs.exe

HOME = d:\emacs\home (微软整路径空格干dan用啊)


(server-start) ;;
(add-hook 'kill-emacs-hook ;;
(lambda() ;;
(if (file-exists-p "~/.emacs.d/server/server") ;;
(delete-file "~/.emacs.d/server/server")))) ;;



参考:

阅读(2088) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~