2011-05 Emacs相关微博

  • [emacs] 多用几次发现allout-widgets不太稳定,似乎有时折叠几下会进入死循环,导致CPU被完全占用,还不清楚问题在什么地方. 版本:ntemacs 24 bzr 20110402 2011-05-03 09:42:20
  • [emacs] iedit.el 可以实现某些IDE里面那种重构时修改方法名、变量名的能力:一次性修改所有出现的方面,随着输入动态修改(如果只该某一部分里的所有实例,可先narrow) http://www.emacswiki.org/emacs/Iedit 2011-05-03 09:44:51
  • [emacs][addons] Scrapbook 1.4.4 加回了多国语言 https://addons.mozilla.org/zh-CN/firefox/addon/scrapbook/ 2011-05-03 15:27:52
  • [emacs] TNND, 终于摸索出来了那个ac-anything2怎么使用 (define-key ac-complete-mode-map (kbd ”C-:”) 'ac-anything2) 2011-05-04 13:21:28
  • [emacs] ac-anything(2)的目的是可以用anything提供的搜索备选项功能,不过auto-complete本身支持C-s搜索,还有fuzzy能力,所以使用ac-anything(2)的必要性似乎不大 2011-05-04 13:25:01
  • [emacs] smex.el — M-x interface with Ido-style fuzzy matching. 用过 ido 的话,试试这个 smex 吧 http://github.com/nonsequitur/smex/ 2011-05-05 09:58:44
  • [emacs] keysnail 的作者 mooz 用的这个配色主题还挺好看的,不知道叫什么 http://d.hatena.ne.jp/mooz/20091207/p1 2011-05-06 12:15:26
  • [emacs] 中午简单试验了一下icicles,发现它跟ido非常象——只是在minibuffer补全上做改进,表明上跟emacs自带的tab补全差不多,很多功能似乎隐藏在一些快捷键后面 2011-05-06 18:00:36
  • [emacs] icicles-imenu 会按imenu 里面的层级关系,让你先选 Defun, Types 还是Variables,然后再选下一级(跟idomenu类似),这比较麻烦,不如 anything-imenu 方便 2011-05-06 18:01:59
  • [emacs] icicles 的作者太能写了,本来挺简单个事儿,被他在EmacsWiki上用了好多篇来写,看得头晕 2011-05-06 18:12:07
  • [RIL][☆][emacs] The single most useful Emacs feature - Stack Overflow http://stackoverflow.com/questions/60367/the-single-most-useful-emacs-feature 2011-05-09 12:02:09
  • [RIL][☆][emacs] Ten Essential Emacs tips http://web.psung.name/emacstips/essential.html 2011-05-09 12:03:11
  • [RIL][☆][emacs] Some Emacs Advanced Tips http://xahlee.org/emacs/emacs_adv_tips.html 2011-05-09 12:04:01
  • [RIL][☆][emacs] effective emacs中文版 - Joyer的日志 - CSDN博客 http://blog.csdn.net/delphinew/archive/2008/01/19/2053676.aspx 2011-05-09 12:04:31
  • [RIL][☆][emacs] EmacsWiki: Emacs Nifty Tricks http://www.emacswiki.org/emacs-en/EmacsNiftyTricks 2011-05-09 12:04:58
  • [RIL][☆][emacs] Tips on Long Term Emacs Productivity http://xahlee.org/emacs/effective_emacs.html 2011-05-09 12:05:40
  • [RIL][☆][emacs] effective-emacs - steveyegge2 http://sites.google.com/site/steveyegge2/effective-emacs 2011-05-09 12:06:06
  • [emacs][vim] (eval-after-load 'viper '(require 'vimpulse)) 2011-05-09 12:17:33
  • [emacs] How to maximize Emacs on Windows at startup? http://www.nujk.com/how-to-maximize-emacs-on-windows-at-startup 2011-05-10 06:02:32
  • RT @mathwuyue: 推荐一本 #emacs 的书籍给各位 #emacs 爱好者:GNU Emacs & XEmacs,Larry Ayers写的。作者本身是个hacker,所以整本书非常hacker,侧重elisp的使用,以及各种错误调试。与之相对的Learning G 2011-05-11 07:21:58
  • [emacs] 昨天折腾了一下英文单词补全,但都不太满意:predictive-mode需要completion-ui和auto-overlay,牵扯一大堆(毕竟我已经有auto-complete了),而且加载还慢… 2011-05-12 08:39:18
  • [emacs] 续: Synonyms是Drew Adams写的,这家伙一贯写注释写得啰嗦,而且那个词库还下载不成功(DTA说下载完了,但打不开),另外它依赖于icicles(这个倒觉得可以接受) 2011-05-12 08:46:09
  • [emacs] 续: 这让我觉得还不如用紫光的英文提示方便。不过跨平台又怎么办?再看看吧,实在不行,自己用auto-complete + /usr/share/dict/words 写一个应该不会比写a-c-scite-api那个难 2011-05-12 08:49:21
  • [emacs] 续: 也不知道直接用auto-complete的ac-source-dictionary 配上 /usr/share/dict/words 性能怎样 2011-05-12 08:53:20
  • [emacs] 看debian的包依赖, 似乎twittering-mode 并不需要ruby? http://packages.debian.org/twittering-mode 2011-05-12 11:49:04
  • [emacs] An Emacs cheatsheet as a mindmap - http://www.dieblinkenlights.com/blog_en/an-emacs-cheatsheet-as-a-mindmap 2011-05-12 21:23:30
  • [emacs] 将customization保存到另外一个文件 (setq custom-file ”~/.emacs.d/custom.el”) (load custom-file 'noerror) 2011-05-16 10:23:38
  • [emacs][TODO] upload iclcles/(dired+,ffap-,fit-frame,menu-bar+,misc-cmds,palette,wid-edit+) 2011-05-17 09:36:43
  • [emacs][TODO] upload icicles/(info+, misc-fns, frame-fns, doremi-cmds, bookmark+-*, help-fns, thing-cmds) 2011-05-17 09:49:25
  • [工具软件] 我说怎么我的Emacs上怎么莫名其妙地每个按键前面都多了一个C-c,原来是灵格斯的“划词翻译”搞的鬼 2011-05-17 18:04:39
  • unix shell的新纪元?可为啥是mac的? 另外我觉得在emacs上捣腾出来应该不太难 RT @gujiaxi: RT @CatJia1990: 神器啊啊 RT @YaoFur: TermKit: 下一代的Mac命令行/终端程序: http://t.co/WymbYoK 2011-05-19 08:29:13
  • [firefox] 地址栏匹配技巧: ”* emacs”只在书签搜索emacs字样;”^ emacs”只在历史记录中搜索emacs字样;另外还有: + 标签(tag), % 当前所有分页(tab) http://is.gd/UAaoWZ 2011-05-19 10:21:59
  • [emacs] 哈哈,最简单的英文单词补全: 先用emacs打开/usr/share/dict/words,然后用其它buffer里用M-/补全 (Linux上那个words指向web2,韦伯词典单词列表 Debian上从这里下载 http://packages.debian.org/miscfiles) 2011-05-20 09:22:19
  • [emacs] 续: 你还可以下载一份fortune-zh,然后用M-/ (dabbrev-expand) 或者hippie-expand来补全唐诗、宋词、诗经——弓虽口阿 http://packages.debian.org/wheezy/fortune-zh 2011-05-20 09:27:47
  • [emacs] 这篇文章里提到了 23.2开始的对completion的改进 http://emacs-fu.blogspot.com/2010/05/emacs-232.html 另外,可以看一下变量 completion-styles 的说明 2011-05-20 12:17:29
  • [emacs][xml] 格式化: M-x sgml-pretty-print 2011-05-20 12:20:09
  • [emacs] projany.el — Project Collection, a unified interface to emacs project managers http://www.panix.com/~tehom/my-code/projany.el 2011-05-20 13:43:53
  • [emacs][TODO] cfg: vi: () sentence, {} paragraph, ^ nb b-o-l, g0 b-o-l, ”xp insert-register, ”xy copy-to-register, M bookmark-set 2011-05-20 17:38:59
  • [emacs][TODO] cfg: zap(-up)-to-char, linkd, tempbuf, recent-jump, fortune~cygwin-mount, 2011-05-20 17:39:12
  • [emacs][vim][joke] - Why are we hiding from the police, daddy? - Because we use vi, son, they use emacs http://is.gd/lzvcFj 2011-05-20 18:02:10
  • [emacs][TODO] conf: drag-stuff, C-f10, linkd, -smex, 2011-05-20 18:19:17
  • [emacs] 哈哈哈, 终于为我的auto-complete-scite-api 找到一个好使的prefix表达式py-complete-completion-re,可以用来补全类似python里”os.path.is…”这种API. 一直没搞定的就是最后那个\\= 2011-05-23 17:47:20
  • [emacs][TODO] gist.el – Emacs integration for gist.github.com - GitHub - https://github.com/defunkt/gist.el 2011-05-24 13:56:22
  • [emacs][python][TODO] Emacs as a Python IDE - PyCon India 2011 - http://in.pycon.org/2011/talks/7-emacs-as-a-python-ide 2011-05-24 14:02:44
  • [emacs][firefox] Manage firefox tabs in emacs with org - http://stackoverflow.com/questions/5958009/manage-firefox-tabs-in-emacs-with-org-mode 2011-05-24 14:30:41
  • [emacs][python] Windows Emacs上终于可以使用ipython了,需要先在ipython.bat里面添加一个-i : python -i ipython.py (不记得以前用不起来是不是没注意这一点) 2011-05-26 14:54:18
  • [emacs][chm][todo] 给emacs-manual-chm增加两点改进: 增加一些颜色(通过css)、accesskey 2011-05-26 15:02:35
  • [RIL] Enjoy Python under Emacs http://mmmyddd.freeshell.net/blog.cgi/Computer/Python/delightedprogpythonunderemacs 2011-05-28 10:06:07
  • [RIL][emacs][python] emacs:emacs23下搭建python开发环境 [杂乱的维基] - http://www.quhuashuai.com/wiki/emacs:emacs23%E4%B8%8B%E6%90%AD%E5%BB%BApython%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83 2011-05-28 10:29:47
  • [RIL][emacs][python] Emacs Python completion - http://www.rwdev.eu/articles/emacspyeng 2011-05-28 10:31:21
  • [emacs][RIL] Putting it in Perspective : Nex3 - http://nex-3.com/posts/72-putting-it-in-perspective 2011-05-28 12:02:21
  • [emacs][RIL] bash like tab completion in emacs http://timchen119.blogspot.com/2007/02/bash-like-tab-completion-in-emacs.html 2011-05-28 12:03:00
  • [emacs][tips] (require 'fuzzy) (turn-on-fuzzy-isearch) 2011-05-28 12:25:56
  • [RIL] Simple tip for browsing python using emacs - http://www.reddit.com/r/emacs/comments/e28ai/simple_tip_for_browsing_python_using_emacs/ 2011-05-28 12:28:15
  • [emacs][linux] 在VirtualBox上试了半天,好像GNOME不能把lwindow映射成super而rwindow映射成hyper。它缺省是都映射成super, 但只能两键一起改成hyper——李杀也在问这个 2011-05-31 16:55:30

 

 

 

 

 

 

2011-04 Emacs相关微博

  • [emacs] Emacs 不流行但很拉风的 feature http://zhengdong.me/?p=406 2011-04-01 06:39:27
  • [emacs][delphi] 唉,emacs用旧了,觉得别的编辑器都不给力,但e里面又没有那些语法相关的功能(尤其是pascal/delphi),于是两边来回切换着用,蛋疼啊 2011-04-01 15:51:03
  • [emacs][delphi] 中午没睡觉,自己写了两个elisp函数来jump to declaration/implementation,原型倒是很快,但为适应各种情况却调试了一个小时 2011-04-01 15:52:35
  • [emacs] 又在看关于缩进的设置了,真是够折腾的。发现 emacs 的缩进设置是这样的:你要从k&r, gnu里选用一种就非常省心,要有自己的风格就折腾死人。不仅仅cc-mode是这样,其它mode也受这个设计影响 2011-04-02 07:28:24
  • [emacs][delphi] 改用pascal-mode了。因为delphi-mode的实现比较怪,导致highlight-symbol, highlight-indentation没法用,也不能自己添加关键字/类型高亮 2011-04-02 13:57:38
  • [emacs][delphi] (modify-syntax-entry ?/ ”. 12b” pascal-mode-syntax-table) (modify-syntax-entry ?\n ”> b” pascal-mode-syntax-table) 2011-04-02 13:58:18
  • [emacs][delphi] delphi 的快捷键不能自定义实在是很挫,跟 #emacs 交叉使用也是蛋疼的办法,我还是找xkeymacs的代码调试一下看看它为啥不工作吧 f 2011-04-02 16:42:03
  • [emacs][TODO] 更新dos.el 2.11, espresso.el 9, js2-mode 20090814 2011-04-06 17:04:06
  • [emacs][TODO] update: fold-dwim 1.4; missing: color-moccur,imenu-tree,ascii,viper-tut/, wsh-repl, js-comint 2011-04-06 17:17:01
  • [emacs][todo] themes: billc, blackboard,empty-void,inkpot,mac-classic 2011-04-06 17:17:10
  • [emacs][cygwin]cygwin-mount似乎有点问题,我这里C-x C-f时输入/usr/share再Tab会变为e:/cygwin2/usr/share,这是对的,再Tab一下它不列出下面文件却变成了e: /cygwin2e:/cygwin2/usr/share/ 2011-04-07 08:49:13
  • [emacs] 与窗口相关windmove, rotate-windows, windswap, tabbar, ide-skel, dedicated, sticky windows 2011-04-07 17:44:30
  • [emacs][chm] CHM of Emacs Manual 23.3 & Org Mode 7.3 uploaded. http://code.google.com/p/emacs-manual-chm/downloads 2011-04-11 14:11:14
  • [emacs][TODO] grep -L autoload *.el 2011-04-13 18:33:43
  • [工具软件][emacs] 我发觉我可以暂时不用hack arsclip的代码来支持emacs了,因为可以配成Shift-Insert的方式来粘贴,vim也可以,唯一不行的就是cmd/console了,那倒不急 2011-04-15 08:41:13
  • Teach Yourself Emacs in 24 Hours.chm里面页面不嵌入图片,要点一下才显示,而且还是跳出一个IE窗口来显示,比较闹心,写了个小py脚本做了个HTML文本替换,搞定了 2011-04-15 15:49:04
  • [emacs] auto-complete里面提供了一个fuzzy.el,只要M-x turn-on-fuzzy-isearch之后C-s就是调用fuzzy实现模糊搜索了 2011-04-15 17:25:34
  • [emacs][TODO] fold-dwim 1.4, setup-cygwin, w32shell, highlight-parentheses 2011-04-15 17:51:11
  • discount: markdown implementation in C. http://www.pell.portland.or.us/~orc/Code/discount/ 这样你就不是非得需要perl来生成html了 [emacs][debian] 2011-04-19 09:28:08
  • [emacs][cygwin][linux] 用xterm-mouse-mode或者gpm-mouse-mode可以让字符终端上的Emacs也能用上鼠标(不过菜单仍然不是下拉式:-) http://goo.gl/XmywJ 2011-04-21 09:56:04
  • [emacs] v23.2以上使用ecb,需要下载最新cvs snapshot;v23.3以上还得加一句 (setq stack-trace-on-error t) 2011-04-21 17:01:26
  • [emacs] emacswiki SVN镜像 http://www.emacswiki.org/emacs/SVN_repository Web访问 http://svn.sv.gnu.org/svn/emacswiki/emacswikipages/ 2011-04-24 20:45:30
  • 那些说Emacs按键比较变态,需要C-x C-c按两下的,你看看Eclipse, Visual Studio 2005的按键列表,看看Vim的补全按键,一样变态,有木有!有木有! 2011-04-27 09:32:30
  • [emacs] 代码折叠的最佳方法 hideshow(vis) + allout(-widgets) 效果图: http://www.cnblogs.com/bamanzi/gallery/image/102213.html 2011-04-27 11:35:23
  • [emacs] allout-widgets 已经在2月份进入emacs 24的代码库了。奇怪的是,挺好的一个东西,而且是蛮有视觉效果的,但几乎没有博文提到这个,甚至作者主页上都没个图 2011-04-29 12:11:40

 

 

 

2011-03 Emacs相关微博

[cygwin][emacs] 开始试用cygwin版本的emacs,感觉好像比native版本要爽一些,ipython/term等都可以正常工作,只是字体只能一种大小了(X版跑不起来,segfault, 还不知道原因) [2011-03-01 11:39:01]

[fonts][unicode] best unicode fonts http://xahlee.org/emacs/emacs_unicode_fonts.html [2011-03-02 07:41:48]

[emacs][RIL] 破解stardict词典数据结构,并在emacs中调用自己的轻量级查词工具 http://blog.meecoder.com/archives/89 [2011-03-03 13:57:41]

写了三天架构文档。唉,每天不折腾一会儿emacs,就好像很空虚似的 :-) [2011-03-04 17:36:52]

[emacs] ntemacs ( http://ntemacs.sf.net ) 又在发版本了,问题是 http://alpha.gnu.org/gnu/emacs/windows 自己都提供win32的版本啊,它ntemacs又没什么不同 [2011-03-05 10:11:35]

[emacs] 昨晚阅读了一下emacswiki上CategoryOutline里面的内容,似乎outline-mode更适合写文档,hideshow更适合写代码,还有其它一些小技巧。今天继续研究一下,差不多了就写篇总结 [2011-03-05 10:46:00]

[emacs][RIL] RT @xah_lee: RT @heystaks_public: "Emacs 23.2 Features" selected in #Unix #HeyStaks http://bit.ly/f7fy1W [2011-03-05 13:37:46]

用手机翻emacs相关推,网友说日本用这东西的人多,看起来还真是,很多都是日文的 [2011-03-05 13:50:29]

[emacs][RIL] RT @xah_lee: #emacs artist-mode lets you draw ascii boxes http://goo.gl/YXuPN [2011-03-05 22:02:22]

[emacs] RT @don9z: #Emacs 困扰我很久的编辑无权限文件即 sudo edit 问题终于用 #tramp 解决了: C-x C-f /sudo::/file/to/ed.it,看起来好像需要通过 ssh,其实只是 subshell。 [2011-03-06 19:22:55]

[emacs] 代码折叠 C-+: fold-dwim-toggle, C-c +: fold-dwim-show-all, C-c -: fold-dwim-hide-all, C-\: toggle-selective-display [2011-03-07 13:28:12]

[emacs]  hidesearch.el --- Incremental search while hiding non-matching lines. 比eassit里面的eassist-list-methods更通用,后者依赖于semantic语法解析 [2011-03-07 13:30:45]

[eclipse][emacs] emacsplus居然支持align-regexp,好耶! [2011-03-07 14:33:11]

[emacs] 从XahLee的文章看来,23.2除了cedet之外,我觉得很有用的是htmlfontify和async-shell-command (M-&) http://bit.ly/f7fy1W [2011-03-07 16:06:32]

[emacs] 原来EMACS还可以这样绑定,哈哈哈: (global-set-key (kbd ”C-c 酷”) 'find-file) [2011-03-08 10:40:44]

[emacs]  再来一个:  (global-set-key (kbd ”C-c 查找”) 'isearch-forward) [2011-03-08 10:42:25]

[emacs] 再来:  (global-set-key (kbd ”C-c 哪个键”) 'where-is) [2011-03-08 10:47:58]

[emacs][org] definition list的表述方式我老是不记得:   keyword :: description [2011-03-08 11:56:02]

[emacs][python] 最简单的补全方法是py-complete,注意不是python-mode自带的pycomplete,后者同时还有一个py模块配合(需要pymacs) [2011-03-08 18:09:52]

[emacs] eassist-list-methods常常不好使,而且有时又不仅是要找函数(只找函数可以用idomenu), 这时就该hidesearch出场了 http://www.emacswiki.org/emacs/hidesearch.el [2011-03-09 14:54:50]

[unicode][emacs] How to insert a unicode character by name? With v23, type 【 Ctrl + x 8Enter】 (ucs-insert), then the name of the unicode. [2011-03-10 07:27:43]

[emacs][RIL] Ten Essential Emacs tips http://web.psung.name/emacstips/essential.html [2011-03-10 07:48:27]

[emacs][RIL] RT @hnfirehose: A gentle introduction to CEDET (Emacs source code browsing):  http://bit.ly/bpybEn [2011-03-10 08:05:11]

[uemacs] Emacs-like imenu for MicroEmacs Jasspa http://www.dgroth.de/pmwiki/index.php?n=MicroEmacs.Macros-Imenu [2011-03-10 09:49:42]

[emacs][python][RIL] Configuring Emacs as a Python IDE | Pedro Kroger http://pedrokroger.net/2010/07/configuring-emacs-as-a-python-ide-2/?ut [2011-03-11 06:44:20]

[emacs] initial-scratch-messages <= cowsay   fortune [2011-03-12 21:42:52]

[emacs][theme] RT @newsery3: An Emacs color theme that integrates well with Ubuntu's Radiance - http://bit.ly/f1xLBQ - [Hacker News FH] [2011-03-13 06:34:11]

[firefox][emacs] 用keysnail插件发推https://github.com/mooz/keysnail/raw/master/plugins/yet-another-twitter-client-keysnail.ks.js [2011-03-13 22:36:03]

[emacs][php][openproxy] 正确的函数查找网址应该是 http://php.chinaunix.net/manual-lookup.php?pattern= [2011-03-14 16:57:41]

[emacs][python] Pylookup is a mode to search the Python documentations from Emacs. http://taesoo.org/Opensource/Pylookup [2011-03-14 20:30:56]

[emacs] 今天配上了w3m (需要cygwin安装w3m,冰将cygwin的/bin和/usr/local/bin加入了exec-path)。可以用它来看Web形式的函数帮助(比如php的) [2011-03-14 20:43:54]

[emacs] 支持frames的w3m: w3m-mee  http://pub.ks-and-ks.ne.jp/prog/w3mmee/ [2011-03-15 09:35:41]

[emacs][cygwin] windows上跑emacs还是离不开cygwin啊,虽然grep,find什么的用mingw, gnuwin32,unxutils的都行,但w3m,man,sdcv,fortune之类还是cygwin下方便 [2011-03-15 13:43:04]

[emacs][geek] 写了几个函数来insert-random-cowsay-fortune,哈哈 [2011-03-16 14:15:23]

[emacs] w32-phantom-key-code 这个设置到底有什么用呢?C-h v里面说得语焉不详,有木有!!!非得看源码才能明白,有木有!!! [2011-03-18 11:08:09]

[emacs] RT @RegexTip also, if you start a normal isearch with C-s, and then realize you wanted a regexp isearch, just hit M-r. [2011-03-18 17:48:53]

[emacs] Window rotate  https://github.com/banister/window-rotate-for-emacs [2011-03-18 18:07:16]

[emacs][org-mode][unicode] 输入\sup1会在导出时得到&#185; ,\sup2得到&#178;,\Delta得到Δ ,可用C-c C-x \切换“所见即所得”状态(你看到的也是&#185;&#178;Δ),具体可查看org-entities。 [2011-03-18 18:33:33]

[emacs][org-mode][unicode] 续上: 关于org-entities,目前我没有找到类似ucs-insert 的浏览插入方式 [2011-03-18 18:34:09]

[emacs][org-mode] 今天偶然发现org里面配了很多&#39;alt开头(不是meta!)的快捷键,用来插入&#171;&#163;&#165;&#195;&#227;等特殊字符,比如A-^ 1输入&#185;, A-^ I输入&#206;,A-1 / 2输入&#189; [2011-03-18 18:41:17]

[emacs]RT @linuxfireurl: 在 Emacs 里面使用 Stardict: posted by wwliu`@ubuntu-cn, *0BluebirdShao: 把这个看懂就行了... http://bit.ly/f3UNKb [2011-03-19 08:23:11]

[emacs][linux] 将&lt;menu&gt;变成&#39;hyper   (define-key key-translation-map [menu] &#39;event-apply-hyper-modifier) [2011-03-19 17:24:00]

在googlecode上升请了一个项目来放我的那些脚本和emacs代码,在linux下用得很顺利,但windows下装了tortoisesvn, 能顺利下代码,但不能提交,检出的时候没问我用户名,现在又没找到地方设用户名。难道要我用命令行从头来过? [2011-03-20 15:19:57]

[emacs] semantic-tag-folding.el #72 (require &#39;semantic/decorate/mode)  #257  (if (called-interactively-p &#39;any) #115 util [2011-03-21 09:02:24]

[emacs] devhelp函数帮助查询: devhelp -s &lt;keyword&gt;    P.S. 源码包里面居然还自带一个devhelp.el, 里面除了查询还提供了了一个assistant,似乎是自动提示功能? [2011-03-22 08:59:56]

[emacs] anything-font-families 所见即所得地选字体  http://d.hatena.ne.jp/mooz/ [2011-03-22 10:51:07]

[emacs] 发现emacs自带一个info-lookup-symbol (C-h S)可用来查函数的帮助,测试了一下elisp,好使。但配置比较复杂,没搞懂,至少awk用缺省配置查不到 [2011-03-22 13:56:20]

[emacs] (windmove-default-keybindings &#39;super) [2011-03-22 17:38:23]

[emacs] RT @nean: あれ? / Emacs で全角スペース/タブ文字を可視化 | Weboo! Returns. http://htn.to/Hix2hq [2011-03-23 08:44:53]

[emacs][g_f_w] RT @milkypostman: New Emacs Icon:  http://t.co/WvlIHqa [2011-03-23 08:47:00]

[emacs][gnome][vim] devhelp的assistant很酷啊  http://lunar-linux.org/~jannis/videos/devhelp-vim.ogv [2011-03-23 17:15:52]

[emacs][vim] Qt有一个类似的assisant http://blog.morpheuz.cc/01/07/2008/qt-assistant-emacs/ [2011-03-23 17:28:56]

[emacs][python] py开发扩展合集 RT @jruariveiro: Python developer and emacs user ? Check out this http://is.gd/npFu1u [2011-03-23 21:46:23]

[emacs][python] 另一套合集EMacs Python Enhanced Tight Ass DOmination https://github.com/haplo/empetado [2011-03-23 22:59:29]

[emacs][todo] 凑一个查函数帮助的大全脚本吧,把chm/hlp/msdn/info/devhelp/qtassist都放进去,找起来也方便 [2011-03-24 16:28:36]

[emacs][firefox] Emacs真是爽啊,修改Firefox扩展,都不用解压.jar文件,直接在里面打开修改。以往我用的是totalcmd,把修改后的文件拖进去覆盖,以为就算挺简单的了,囧 [2011-03-24 19:14:11]

[emacs][vim] 好多Vim相关的漫画  http://hotoo.googlecode.com/svn-history/r297/vimwiki/Vim.html#toc_1.17 [2011-03-25 09:18:05]

[emacs][javascript] RT @daleharvey: Coding javascript in emacs? I published jshint-mode - https://github.com/daleharvey/jshint-mode [2011-03-26 14:07:43]

[javascript][emacs] REPL for wsh&#39;s javascript  https://github.com/jonnay/wsh-repl [2011-03-28 11:14:05]

[emacs] Automatic highlighting current symbol minor mode https://github.com/mitsuo-saito/auto-highlight-symbol-mode [2011-03-28 18:55:14]

[vim]Indent Guides RT @superbobry: I wonder if there's anyth'g similar 4 #emacs -- couldn't find nothing on EmacsWiki http://goo.gl/bPik4 [2011-03-29 07:59:52]

[emacs][unicode] HTML/XML Entities (Char/Unicode/Symbol) List http://xahlee.org/comp/unicode_html_entities.html [2011-03-29 09:40:42]

[emacs] 原来emacswiki的那些代码在sf.net上也能找到,http://emacswikicode.cvs.sourceforge.net/viewvc/emacswikicode/ [2011-03-29 11:11:18]

[emacs] 今早终于有时间来改auto-complete-scite-api的性能改进,虽然上周大体考虑了一下觉得比较简单,但调试时还是发现有几个小地方基本上没考虑到 [2011-03-29 11:21:38]

[emacs] ac-scite-api: 测试了java160.api (1.4M)和python.api (1.8M),性能都还不错,但python.api 里这种包含整个包路径的API会造成输入包名时补全项太多,性能上应该还有优化空间。先“发布0.2”再说吧 :-) [2011-03-29 11:27:17]

[emacs] RT @xah_lee: #Emacs #Lisp basic example: Count Words/Chars http://goo.gl/1JdAs → exercise: count lines [2011-03-30 07:30:01]

[emacs] RT @xah_lee: How To Use And Setup #Emacs's whitespace-mode http://goo.gl/22tAl [2011-03-30 07:54:12]

[emacs] 我的auto-complete-scite-api 发了v0.2  http://is.gd/acQlIO [2011-03-30 09:41:35]

[emacs] Indent Guides for Emacs (highlight-indentation) https://github.com/antonj/Highlight-Indentation-for-Emacs/  算是对前面vim上此功能的回应 [2011-03-30 09:56:28]

[emacs][lisp] v23.1上那个ido-jump-to-window会卡在ido-completing-read上,对比了一下v24的ido.el,后者在这个函数里会调用ido-common-initialization,将其内容添加到v23.1之后就好使了 [2011-03-30 11:29:08]

[emacs][orgmode][unicode] 上次说的org-entities, 输入\之后,按M-TAB可补全——不知道org还提供哪些补全 [2011-03-30 13:28:47]

[emacs] 参照windmove和上次看见的window rotate写一个交换的函数,还是很简单的嘛 [2011-03-30 17:41:15]

[emacs] 刚才翻一个HTTP 1.1 RFC的txt文档,我拖到emacs里面去,M-x rfcview-mode, 然后就有了菜单、目录跳转,加上我配置的H-*/#和sdcv查询,把同事看得眼花缭乱,哈哈哈 [2011-03-30 18:05:02]

Technorati Tags:

 

 

 

 

 

 

2011-02 Emacs相关微博

  •  
  •  
  •  

294. [emacs][theme] Naquadah theme  http://julien.danjou.info/blog/index.html#Naquadah_theme_for_Emacs [2011-02-01 12:04:07]

295. [emacs][orgmode] 听了一下Google Tech Talk on Emacs Org-mode(昨天从youku下载的),发现自己现在英文听力提高了不少——难道是最近几个月看英美剧集的结果? [2011-02-01 15:17:17]

301. [emacs][addons] Textmate minor mode http://ozmm.org/posts/textmate_minor_mode.html [2011-02-01 21:43:55]

302. [emacs][geek] RT @echoes2099: #emacs keyboard shortcuts in Microsoft Word. U heard right! #vbacs #linux http://tinyurl.com/5rqt494 [2011-02-02 13:06:47]

303. [emacs]RT Latest #emacs trunk code changes the way mouse & X11 pasting works. Read this thread if you want the old setup http://ur1.ca/32o1j [2011-02-02 13:56:48]

311. [emacs][video] 上传了一份emacs-cua-rect.flv到土豆网,我从vimeo.com下载的  http://www.tudou.com/programs/view/He4etr8Q5Ag/ [2011-02-05 17:26:29]

314. [emacs] GNU Emacs 24提供了describe-package命令, 应该比那个finder-commentary好记一些 [2011-02-05 21:15:06]

316. [emacs][RIL] Key Binding Conventions http://is.gd/qy9grg [2011-02-06 08:50:34]

318. [emacs][RIL][python] RT @xah_lee: Unicode Support in #Ruby #Perl #Python #javascript #Java #Emacs Lisp #Mathematica http://goo.gl/f3fDW [2011-02-07 08:07:57]

336. [emacs][iphone] 不知道怎么解决“脚踏板”问题的,难道是用ssh连上去运行?RT @basimple: #Emacs for iPhone http://gamma-level.com/iphoneos/ports/emacs [2011-02-08 18:40:34]

337. [emacs][RIL] Elisp Lesson: Execute/Compile Current File http://is.gd/D7rLXH [2011-02-08 22:55:11]

347. [emacs][RIL] RT @doitian: Mickey Petersen: Mastering Key Bindings in #Emacs http://bit.ly/dGC6vp [2011-02-09 13:48:59]

351. [emacs][xml] RT @stickster: @jsmith #Emacs for #XML editing write-up is here: http://ur1.ca/363ts Similar automation for #vim exists, you or [2011-02-10 09:39:49]

358. [emacs][geek] RT @samdonnelley: #Emacs Reference Mug by rudzitis.org - Awesome way to keep caffeinated and ...  http://is.gd/CTKhe2 [2011-02-11 23:02:18]

360. [工具软件][emacs] 哈哈,我把Caps Lock映射成了App,这样我的emacs里面左右都有hyper键了 (为了以防万一,还是保留了Caps Lock,放在了右Windows键上) [2011-02-12 14:16:32]

365. [工具软件] 续: 顺便还改了一下对xemacs/uemacs的缺省禁用,一些console程序的判断,中文Windows上的一些窗口判断(原版是针对日文版判断的) [2011-02-14 17:01:28]

376. [emacs][python] RT @yunh: A new major-mode for Python http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg00655.html [2011-02-16 00:16:09]

377. [emacs][iphone] RT @basimple: #Emacs for iPhone http://gamma-level.com/iphoneos/ports/emacs [2011-02-16 00:17:35]

380. [uemacs] 刚才无意中发现jasspa里面可用esc =激活主菜单(原来禁用了Alt+&lt;key&gt;激活菜单之后就一直困惑这个),esc +激活上下文菜单。但没找到关闭的方法 [2011-02-16 20:11:00]

382. [emacs] RT @xah_lee: RT @johnnyjacob: Very good #emacs #elisp tutorial - http://is.gd/k3szbw [2011-02-17 09:07:12]

387. [emacs] 对外发了俺写的第一个emacs扩展: 用Scite API文件作为自动补全函数源 http://bamanzi.is-programmer.com/posts/24558 [2011-02-17 23:51:04]

390. [TODO] 介绍microemacs,主要是jasspa [2011-02-18 09:20:08]

395. [emacs] 从 http://alpha.gnu.org/gnu/emacs/windows/  下载新的v24 alpha版本,发现org更新到了7.3, 多了一些theme。 [2011-02-18 17:04:51]

396. [emacs] 续:刚发现我上次安装的是20101110, 再上次是20100708,不算太频繁哈。(之前都是从e4w项目下的 http://code.google.com/p/emacs-for-windows/  ) [2011-02-18 17:27:29]

401. [uemacs][blog] 新文章: 介绍一下MicroEmacs http://bamanzi.is-programmer.com/posts/24605 [2011-02-20 20:35:26]

424. [emacs] emacswiki RIL: ScimBridge_Chinese, AutoPairs, DumpEmacs [2011-02-23 16:25:03]

434. [uemacs] jasspa最大的缺点是不支持各种encoding (至少得支持utf-8, utf16-le &amp; 当前ANSI吧) [2011-02-24 17:50:59]

435. [emacs][php][openproxy] 查PHP函数可以用这个网址  http://php.chinaunix.net/manual/zh/function.{function}.php  不过function里面要将_变成- [2011-02-24 18:11:04]

442. [emacs][RIL] Sylvester324 :在Emacs中构建我的字典(sydict) 使用startdict的文件创建我自己的Emacs字典查询函数。http://sinaurl.cn/hGSuSA [2011-02-28 07:26:48]

443. [emacs][RIL] Making Emacs Stand Up To Visual Studio 7 || kuro5hin.org http://www.kuro5hin.org/story/2003/4/1/21741/10470 [2011-02-28 07:39:18]

446. [emacs][RIL] RT @edipretoro: Emacs-fu: executable source code blocks with org-babel: http://tinyurl.com/4lt9jnb (#orgmode #emacs) // great t [2011-02-28 08:21:19]

447. [emacs][RIL] RT @xah_lee: A Text Editor Feature: Extend Selection by Semantic Unit http://goo.gl/LdDbZ #Mathematica #emacs #vim #eclipse [2011-02-28 08:35:05]

449. [emacs] 刚意识到之所以我会在闪存上加了许多Xah Lee的文章到RIL标签上,是因为Xah Lee不在Planet Emacsen上(为啥?),于是到GR上订阅了他的RSS,这里就不轻省了,哈 [2011-02-28 10:37:47]

 

 

Technorati 标签:

 

  •  
  •  

 

图说MicroEmacs Jasspa版本的亮点功能(1)

如前面那篇《介绍一下MicroEmacs》所述,Jasspa是MicroEmacs的一个分支版本,也是最有影响力功能特性最多的一个。

Jasspa主页:http://www.jasspa.com

作者提供了Windows/DOS/Cygwin, Sun, Linux, AIX, Mac, OpenBSD/FreeBSD等多种平台的二进制包供下载。

 

File Browser和Shell

file browser & shell in microemacs jasspa

跟GNU Emacs一样,Jasspa可以在里面运行shell交互环境(在Windows上它跟Cygwin结合得也很好,可以直接用M-x cygwin来启动cygwin shell)。

Toolbar

Jasspa允许给上下左右添加toolbar(其实类似“现代编辑器”里面的ToolWindow),有win和page两种方式(也就是平铺还是叠加,后者类似“现代界面”里面的两个工具窗口停放到不同的标签上),提供的功能有文件浏览器、Item List(函数/变量列表)、Buffer List、书签列表等等,用S-F11可以隐藏全部toolbar。跟GNU Emacs不一样的是,toolbar跟buffer不会混淆,不会出现在GNU Emacs里面那种将文件在一个speedbar窗口中打开的问题。

对话框

GNU Emacs的用户都倾向于不使用菜单、工具栏和对话框,因为这都不如一两次按键那么有效率,很多时候还得借助于鼠标,效率就更低了。但它们也有一个优点:会让新手很容易探索到某个分类里大概有一些什么功能,比如你知道GNU Emacs里面缺省对于较长的行有几种显示方法?你看一下菜单Options->Line Wrapping in this Buffer就知道有Wrap at Window Edge、Truncate Long Lines和Visual Line Mode三种(GNU Emacs里面比较赞的是你可以用C-h k然后点击一个菜单项让它告诉你究竟是调用了什么elisp函数,这样你下次可以用M-x的方式或者绑定按键的方式来使用这个功能了)。

Jasspa里面工具栏(如上所述)、菜单和对话框都用得比较多,你在这里可以方便地将jasspa设置为client-server模式,挑选theme, 加载/卸载某个mode,配置鼠标按键的行为等等。

这些对话框、菜单和工具栏都是用宏语言写出来的,下面也是调用其它的宏,所以你也可以用宏来操作。这就叫简单、效率两不误。

 

 

 

Searching...

介绍一下MicroEmacs

看见vmlinz在玩JED((轻量级Emacs--JED介绍 - vmlinz's Blog),于是也装了一个玩玩,但我对它的GUI版本很不满意。该文章里面又说到了其它的轻量级编辑器,里面有个叫做MicroEmacs的。想起以前看见网上说Linus用的就是这个叫做MicroEmacs的编辑器(据说他还说了GNU Emacs is just evil,但我没找到确切的出处,只在EmacsWiki上看到过[link])。好,去找来玩玩。

但在Google上一搜,居然没有看到一个象MicroEmacs官网的网址,中文的说明也很少。在Wikipedia [link]和EmacsWiki [link]上看了一下介绍才明白,这个东西诞生在80年代,因为体积不大,互联网又没有出现,所以大家就拷来拷去,改出了好多个分支:

  1. 原始作者Daniel Lawrence 自己的版本(不过最早的作者是Dave Conroy),,最新版本是09年2月出的5.00,但提供了源代码和Windows版本,似乎用的人不多。网上其它地方可以找到3.12和4.0版本,这两个版本以前使用比较广泛;
  2. uEmacs/PK,作者是Petri H. Kutvonen,基于Lawrence原版的3.9e分支出来的。最后版本是4.0.15, 各个kernel.org镜像上均可以下载到源代码[uemacs]
  3. Linus他们在kernel.org上维护的另一个分支(git仓库链接),基于uEmacs/PK,是在P.K.停止开发后,Linus接手的(这也是为什么kernel.org上有uemacs/pk的下载连接);
  4. 最受欢迎、最有名(似乎功能也最强的)的一个版本是Jasspa,它在1987年就从原版MicroEmacs 3.8中分支出来,增强了特别多,下面将会详细介绍其特性;
  5. 我十年前读书的时候淘到一张C++ User Group的光盘,里面就提供了一个Windows 3.1 GUI的port,似乎改动也不小(要知道除了jasspa,其它版本大多只有终端版本)。刚才在网上搜了半天,找到说是Pierre Perret 基于Lawrence的MicroEmacs 4.0做的,不过其所在网址已经打不开了(已经排除了G.F.W的因素);
  6. 还有其它一些分支和变体,比如快捷键跟GNU Emacs更接近的mg(原名MicroGNUEmacs。它甚至有个WinCE版本),克隆vi 的vileersatz emacsConroy MicroEmacs等等。前面说的JED跟MicroEmacs也有些渊源。。

为什么这么有名的东西,在Linux里面没有见到过呢?因为原始作者Daniel Lawrence是个激进的反GPL分子,多次明确表示不同意将这个东西变成自由软件(free software)——虽然它一直是开放源码(open source)的。一直到了2002年,Lawrence才松口。至于02年之后为什么还没进入各个distribution,我就搞不清楚了(估计是没有吸引力不够?)不过FreeBSD里面是收录了它的。

本来是打算主要介绍Jasspa的主要特性和亮点功能的,没想到前面这版本的考证工作费了我不少时间(而且各处的说法还有些相互矛盾的,比如),所以Jasspa下次再讲吧。

总体说一下MicroEmacs:。它的主要特性有:

  • 按键的行为可配置
  • 多窗口编辑
  • “菜单”可配置
  • 可通过宏语言来扩展
  • 轻量级(加上配置都不到1M)

缺点:虽然有Linus这样的牛人在顶这个东东,但它跟“现代”编辑器的差异还真的很大,大多只有Console版本(除了我上面说的CUG的那个Windows GUI port和Jasspa之外),不支持语法高亮,甚至C-x C-f 都不一定能提供补全,Shell集成也。

当然基本的多窗口编辑、shell集成、可通过宏进行扩展这些基本思想还是有的,你拿它来替代nano还是绰绰有余。——但Jasspa 就不一样了,它完全可以用“麻雀虽小、五脏俱全”来形容,可说是功能齐备、文档详尽、配置方便、扩展容易。这个下次再详细讲吧。

microemacs  mg on wince


对了,还有一点忘了说了,这个MicroEmacs有个别名叫uemacs,因为μ跟micro是差不多的意思。有不少地方都是直接用uemacs这个名字。

如果你想试试,Windows版本可到Daniel Lawrence的主页下载,那里有最新的5.00版本(好像这个网站刚被G-F-W屏蔽了,你可以下载我这里的副本uemacs5.zip(windows console版本和源代码) me404gui.zip(windows gui版本));Linux和其它平台的版本可以到这里下载 [mtxia.com],注意这里虽然也提供了5.00版本(仅Windows版本和源代码),但Windows版本不能正常运行。 下载后注意将exe和那些.cmd宏文件放在一起。

参考:

Technorati 标签: , ,

 

 

 

 

 

 

mtxia.com

 

Searching...

[emacs] auto-complete上使用scite的api文件进行补全

Scite编辑器提供补全功能,备选的函数都由一个外部文件(内容很简单,就是每行一个函数原型)提供,这个文件它称为API文件,每种编程语言可配置一个。

这个机制对于那些非对象化的编程语言来说(比如PHP, Perl, AutoHotKey), 是相当简单方便的,自己可以用一些工具来生成这个文件。即使是对象化语言,有时也很有用,比如Java里面import的时候可以用这种机制来补全包名,或者用全路径方式调用静态函数(比如Python里面os.path.exist())。

以前常用Vim,就怀念这种简单的补全机制。后来用Emacs,也没有看到类似的,一次还发现一个增强的php-mode居然是采用硬编码的方法来提供备选函数的。

于是就想自己写一个,但自己玩Emacs没多久,编码能力不够,一直到了年底,才晃晃悠悠地把这个东西写出来了。这算是我正儿八经写的第一个Emacs包(以前都是在自己的~/.emacs里面折腾各种配置)。

下载: [[file:auto-complete-scite-api.el]] 


 

要使用这个包,需要先安装配置好Auto Complete,它界面漂亮、操作方便、配置简单,自身提供了多种source来进行补全(比如文件名、elisp符号名、Emacs包名、其它buffer中的单词、Semantic、Eclipse(eclim)等),可以根据自己需要来配置每种编程语言需要那些sources。具体配置和使用说明可参见Emacs中文网上的这篇 Emacs补全利器: auto-complete+gccsense (注意: ahei的这篇文章 用auto-complete实现自动补全 是针对老版本auto-complete的(<=0.3),v1.0以上版本变动较大,配置也简单得多了)。

 

使用方法:

  • API文件需要放到/usr/share/scite/api/或者~/.scite/api/两个目录下。如果想放其它目录,可在~/.emacs中设置ac-scite-api-directories。除了SciTE自带的哪些API文件,你还可以到scite-files项目里去找其它人提供的(或者生成工具)。注意每种major-mode会根据如下两种规则读取对应的API文件
    1. major-mode-name - "-mode" + ".api",比如php-mode就会去找php.api
    2. 文件扩展名+.api,比如init.el就会去找el.api和
    3. 如果两个机制都能读取到文件,都会加载(不过目前没处理重复项目),比如编辑functions.pyw文件时会加载python.api 和pyw.api。你可以用这个机制来将区分系统配置和个人配置。
  • 在Emacs中配置:

如果打算在所有使用auto-complete的地方使用这个(推荐),就把ac-source-scite-api添加到ac-sources缺省值里去

(load "auto-complete-config") 
(if (load "auto-complete-scite-api" t)
    (setq-default ac-sources (cons 'ac-source-scite-api ac-sources)))

如果只想在某些模式中使用,还是操作ac-sources(因为ac-sources是每个buffer独立的),不过我提供了一个ac-enable-scite-api-source函数

(if (load "auto-complete-scite-api" t)
     (progn
        (add-hook 'php-mode-hook 'ac-enable-scite-api-source)
        (add-hook 'xahk-mode-hook 'ac-enable-scite-api-source))) 

这个ac-enable-scite-api-source可以交互式调用,即在需要的时候即时打开,M-x ac-enable-scite-api-source。

 

自动补全的效果图 (后面带A的即是由本模块提供的候选项),黄色部分是用Auto Complete机制提供的当前候选项的说明(如果API文件里面提供了的话)

 

作为一个顺带的功能,你可以在任何函数上按M-F1来查看该函数的说明(显示在echo area)——如果API文件中提供了的话。

 

补充说明:

  • 在GNU Emacs 23.2/24.0.50和Auto Complete 1.2/1.3上验证过可用。
  • 如果API文件过大,第一次的性能比较慢,最好文件不要超过500k, 建议删除一些不常用的函数(比如我机器上工具生成的python.api里面包含了很多pyqt的包和函数,而我很少用到)

Technorati 标签: , ,

 

 

 

[emacs]搜集了一些color-theme主题

从emacswiki和github上搜集了一些color-theme的主题和工具。

包含如下主题:

themes
color-theme-billc.el
color-theme-blackboard
.el
color-theme-chocolate-rain
.el
color-theme-cobalt
.el
color-theme-complexity
.el
color-theme-dark-emacs
.el
color-theme-desert
.el
color-theme-dirac
.el
color-theme-dpaste
.el
color-theme-espresso
.el
color-theme-github
.el
color-theme-hober2
.el
color-theme-icu
.el
color-theme-inkpot
.el
color-theme-ir-black
.el
color-theme-merbivore
.el
color-theme-molokai
.el
color-theme-pink-bliss
.el
color-theme-quiet-light
.el
color-theme-railscasts
.el
color-theme-rejeep
.el
color-theme-sanityinc
.el
color-theme-slate
.el
color-theme-subdued
.el
color-theme-tango
.el
color-theme-tango
+.el
color-theme-tangotango
.el
color-theme-thunk1
.el
color-theme-vibrant-ink
.el
color-theme-zenburn
.el

另外还包含了一些工具:

utils/
color-theme-maker.el
color-theme-random.el
color-theme-reg.el
color-theme-x.el

下载地址:   color-theme-6.6-packs.zip

 

[emacs] CUA的矩形块操作很给力啊

原始矩形块模式

emacs以C-x r开头的命令来进行矩形操作。先用C-space或者C-@设一个mark,移动光标到另一点,用以下命令进行列操作:

C-x r k 剪切一个矩形块
C-x r y 粘贴一个矩形块
C-x r o 插入一个矩形块
C-x r c 清除一个矩形块(使其变成空白)
C-x r t 在选定区域的所有列前插入样的字符

 

cua-mode支持的可视化块模式

除了emacs本身支持的列模式外,emacs还可以通过cua-mode支持一种可视化的列模式。在cua-mode下,按[C-return]会进入cua rectangle模式。在这个模式下可以通过鼠标点击确认起点,然后通过光标键来选中一个rect范围,这个rect会用另外的颜色显示出来。

之后我们 就可以很方便地对这个rect进行操作。比如[M-up],[M-down],[M-left],[M-right]可以移动这个rect,[C- return]可以取消这个rect,[C-space]可以退出cua-rect模式并激活普通模式下的选择。

cua-mode下可以用以下命令进行列操作:

直接输入字符: 在每行前(或后)都插入这个字符
[M-a]: 将rect中的文字左对齐
[M-b]: 用空格(tabs或者spaces)替换所有rect中的字符
[M-c]: 去掉所有行左侧的空格
[M-f]: 用单个字符替换所有rect中的字符(提示输入一个字符)
[M-i]: 对每行中第一个找到的数字进行加1操作(自动把0x开头的当作十六进制数字)
[M-k]: 剪切rect
[M-l]: 把rect中的内容全部转换为小写
[M-m]: 拷贝rect
[M-n]: 用一串自增的数字替换rect中的每一行(这个功能可以用来给每行编号)
[M-o]: rect的内容右移,选中的rect用空格填充
[M-r]: 用字符串替换符满足正则表达式的字符串
[M-R]: 上下反转<br />[M-s]: 把rect中的每一行替换为一个字符串(提示输入)
[M-t]: 把rect整个替换为一个字符串(提示输入)<br />
[M-u]: 把rect中的内容全部转换为大写<br />
[M-|]: 对rect执行一个shell命令<br /></span>
 
还有一些其他的命令可以直接看cua-base.el(emacs22之后已经自带。另无意中发现一个阅读package说明的方法: M-x finder-commentary)。
Emacs用户手册里面对CUA介绍得比较简单,可到原网站阅读说明 http://www.cua.dk/cua.html
 
用鼠标来选择矩形块
看了一下cua-rect里面的代码,发现对鼠标有一些支持,但不是太好用(得先用C-return激活块模式,然后用mouse-1确定起点,mouse-3确定终点并拷贝)
 
简单地尝试了一下,改成如下方式: 第一次点击确定起点,第二次点击确定终点。为了方便,使用了hyper这个modifier key。
 
    (require 'cua-rect)
    (defun hkb-mouse-mark-cua-rectangle (event)
      (interactive "e")
      (if (not cua--rectangle)
          (cua-mouse-set-rectangle-mark event)
        (cua-mouse-resize-rectangle event)))
    (global-set-key (kbd "<H-mouse-1>") 'hkb-mouse-mark-cua-rectangle)
    (define-key cua--rectangle-keymap (kbd "<H-mouse-1>") 'hkb-mouse-mark-cua-rectangle)
 

给Emacs安装一个脚踏板: 用Windows/Menu键作为key modifier

是不是觉得Emacs的按键都很长,很难记(比如打开文件是C-x C-f,矩形填充是C-x r t,CEDET跳转是C-c . j)?  想要修改吧,各个键都有自己本来的含义,Emacs留给用户的只有C-c a到C-c Z(以及其它更长更复杂的按键)。所以才会有“Emacs用户都恨不得给电脑安装两个脚踏板的说法。

ergoemacs ( http://code.google.com/p/ergoemacs/ )的keybinding是个好东西,尤其是对于普通用户,你可以用C-c拷贝、C-v粘贴, C-z恢复,C-o打开文件。 不过跟 上面同样的问题,对于老手,原来习惯的按键用不上了(尤其是是找不到原来的M-x了!);而且要是习惯了这样的按键,换个地方又无所适从了。

有没有即保留原来的按键,又能支持新的方式呢?

除了真的安装一个脚踏板, 我也不知道这个问题是否真的有答案。不过我无疑中发现了可以用目前常见键盘上的Windows键和Menu键来作为新的key modifier(可用作super或者hyper)。在Windows下只要用(setq w32-lwindow-modifier 'super)初始化一下就行了,然后它就能将Windows+i识别为S-i,于是你就可以绑定到函数了。(在Linux下如何设置待有时间再来研究)

下面是我根据这个思路搞的配置,将Menu键(在键盘右边,Emacs里面叫做apps键)和左边的Windows键都设定为hyper了,然后可以用H-c来拷贝, H-o来打开文件。

注 意对于windows键相关的组合,如果已经注册为系统热键(Windows自带的Win+r/Win+e或者程序通过RegisterHotKey注册 的),则系统优先使用,Emacs抢不到(我原本是想将Windows设置为super,Menu设置为hyper,这样就有两个"脚踏板"了,但由于我 已经用别的工具注册了大部分Windows+?键,而且键盘左边又没有Menu键,所以最后将左边的Windows和右边的Menu都绑定到了 hyper)

 

;;(setq w32-pass-apps-to-system nil)
(setq w32-apps-modifier 'hyper)

(setq w32-pass-lwindow-to-system nil)
(setq w32-lwindow-modifier 'hyper)


;; editing
(global-set-key (kbd "H-c") 'kill-ring-save) ;; copy
(global-set-key (kbd "H-x") 'kill-region) ;; cut
(global-set-key (kbd "H-v") 'yank) ;; paste

(global-set-key (kbd "H-a") 'mark-whole-buffer) ;; select all

(if (featurep 'undo-trees)
(progn
(global-set-key (kbd "H-z") 'undo-tree-undo)
(global-set-key (kbd "H-S-z") 'undo-tree-redo)
(global-set-key (kbd "H-y") 'undo-tree-redo))
(progn
(global-set-key (kbd "H-z") 'undo)
(if (featurep 'redo)
(progn
(global-set-key (kbd "H-S-z") 'redo)
(global-set-key (kbd "H-y") 'redo)))))



;; files
;;(global-set-key (kbd "H-n") 'create-empty-buffer) ;;FIXME
(global-set-key (kbd "H-o") 'menu-find-file-existing)
(global-set-key (kbd "H-s") 'save-buffer)
(global-set-key (kbd "H-S-s") 'write-file)

;; search
(global-set-key (kbd "H-f") 'isearch-forward)
(global-set-key (kbd "H-h") 'query-replace)
(global-set-key [H-f3] 'nonincremental-repeat-search-forward)
(global-set-key [C-H-f3] 'nonincremental-repeat-search-backward)

;; bookmarks (within buffer)
(if (featurep 'bm)
    (progn
      (global-set-key [H-f2] 'bm-next)
      (global-set-key [C-H-f2] 'bm-toggle)
      (global-set-key [S-H-f2] 'bm-previous)))

;; completion (Emacs default: M-TAB - lisp-complete-symbol, M-/ - dabbrev-expand)
(global-set-key (kbd "H-/") 'hippie-expand)