随笔分类 - GNU Emacs
marstering emacs
摘要:纵览emacs 文档中描述,进缩风格实现只需要两步:第一步,根据内容与上下文找到对应的进缩风格的类别;第二步,依据进缩风格决定的表达式锚点的进缩偏移。下面我们对 cc-mode 风格定制加以说明。进缩风格的类别比如在 C 代码中,使用 C-c . 然后再使用两次 tab ,就可以出现多个内置风格供选...
阅读全文
摘要:在Emacs的手册16.1节中有这样一句话,Any command other than an undo command breaks the sequence of undo commands. Starting from that moment, the entire sequence of undo commands that you have just performed are themselves placed into the undo record, as a single set of changes. Therefore, to re-apply changes you h
阅读全文
摘要:使用下面的语句(set-default-font "Monaco-12")前提是系统中安装了Monaco字体,后面的12代表字号,所以可以使用类似的格式设置任意字体。
阅读全文
摘要:配色方案需要安装插件,地址如下http://download.savannah.gnu.org/releases/color-theme/安装说明地址如下http://www.emacswiki.org/emacs/ColorTheme简要说明安装方法1.将下载的插件包解压到一个目录中,然后向.emacs文件中添加下面的代码;; 加载配置文件的路径(add-to-list 'load-path "~/.emacs.d")(require 'color-theme)(color-theme-initialize);; 下面的配色方案任选其一;;(color-t
阅读全文
摘要:首先,下载Emacs For Windows,地址如下http://ftp.gnu.org/pub/gnu/emacs/windows/其次,解压,运行bin目录下的addpm.exe,即可将向开始菜单添加GNU Emacs启动项。最后,配置路径,Windows 7下默认的路径为C:\Users\<username>\AppData\Roaming,然而这个路径过于隐蔽,而且是在C盘,重装系统容易丢失,所以给出两个更好的方法:1.向注册表中添加HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs\HOME=%emacs_dir%,GNU和Emacs都是新建的键
阅读全文
摘要:(defun count-words-region (beginning end) "Print number of words in the region." (interactive "r") (message "Counting words in region ... ") (save-excursion (let ((count 0)) (goto-char beginning) (while (and (< (point) end) (re-search-forward "\\w+\\W*" end
阅读全文