Archive

Archive for the ‘Emacs’ Category

Emacs unicode的中文字体……

March 29th, 2006 No comments

因为要unicode的支持,我一直都是用的Emacs 23,也就是Emacs unicode branch。虽然还是alpha阶段,但是直到上个星期它一直都很好的工作着。上星期趁着系统更新重新emerge了emacs-cvs,结果发现更新以后的Emacs中文显示很小,看上去像是楷体,根本没有办法看(不过有一点,在LaTeX模式下面发现中文字体有大小区别了,不在像以前那样始终只有一个大小,或许是Emacs 23的新特性吧) :-( 哭啊,Google好久,怎么设置都没有办法让中文显示的好一点。早知道就不重新emerge了,以前什么设置都没有做中文照样工作的很好的。唉,再也不乱随便更新了……

上linuxsir发了帖子求助,现在用一下的.Xdefaults配置凑合着能用了。

Emacs.Font: fontset-chinese
Emacs.Fontset-0: -adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-chinese,\
ascii: -adobe-courier-medium-r-normal–14-*-*-*-*-*-iso10646-1,\
chinese-gb2312:-*-simsun-medium-r-*-*-16-160-72-72-p-160-iso10646-1

过一段时间再emerge吧,反正已经不好了,也不怕了。

Tags:

Emacs Wiki — 很好的做笔记的工具

March 18th, 2006 No comments

前段时间的笔记都是用Emacs Wiki做的,放在自己电脑里了,真的很方便。Gentoo里面安装很方便:

emerge -avt emacs-wiki

Gentoo不仅是提供了非常多的软件包,而且对这些软件的管理也很不错。像Emacs Wiki这样的Emacs插件安装以后他自动更新了一个文件:site-gentoo.el。这是一个维护新插件的文件,你只要在你的.emacs文件里面load这个文件就可以使用了,都不用自己去编辑。

Emacs Wiki提供了一些默认的标记语法,语法很简单,一下就可以学会的。这里给出一些我当时学习时遇到的有用的链接。

Liyu的主页里的介绍
薛瑞妮的主页里的介绍

Tags:

Junk characters in Emacs

January 30th, 2006 No comments

The newly installed Emacs 23 on my Gentoo displays some junk characters in the emacs shell when I use “ls” in it.(some thing like “^[01[03m…”) Really annoying at first but after gooled, I found the solution, just add this in .emacs file:

(add-hook ’shell-mode-hook ‘ansi-color-for-comint-mode-on)

All goes well then and you can see different colors to indicate different kinds of files in emacs shell when you use “ls”. I didn’t see this feature when I were using Emacs 23 on SuSE.

Tags:

Emacs 23 and unicode support

January 16th, 2006 No comments

I am using UTF-8 encoding on my system. I have to do so because: (1) I speak Chinese and I have to mix Chinese and English. (2) I have a FAT32 partition which uses UTF-8 encoding and I have some files using Chinese names in it. I don’t know how to change it’s encoding. (3) UTF-8 encoding has many benefits and I hope it will become the mainstream.
But here comes the problem. Emacs 21 doesn’t have support for Chinese UTF-8 encoding, when I open a Chinese text file which is encoded in UTF-8, all I got are backslashes and digitals… Luckily enough, there is already Emacs supporting what I need though not very stable stable—that’s Emacs 23. It’s internal encoding is based on UTF-8. So far, it can only be got from the Emacs CVS repository. Using the following command:

$: export CVS_RSH=ssh

$: cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/emacs co -r emacs-unicode-2 emacs

After getting the source code, use “make bootstrap && make install” to compile and install it. Now it’s working quite well on my system. Really great! But I still don’t know how to make LaTeX work with UTF-8 encoded Chinese text files, so sometimes I have to use iconv to convert from UTF-8 to GB2312 or directly edit files encoded in GB2312 with Emacs. It’s not so convenient but I can bear it :-( . Things will be even greater if I can use UTF-8 encoding for all my files!

Tags:

JDEE compile time error: buffer is read only

January 12th, 2006 No comments

JDEE compile time error: “buffer is read only”

I use JDEE to write Java programs in emacs. The problem I encountered is that when I compile the program(C-c C-v C-c), the JDEE compile buffer has nothing to display and actually nothing was compiled. The mini buffer is saying “buffer is read only”. After googled some articles, I solved the problem.

Open the file compile.el in /usr/share/emacs/lisp/progmodes, search “buffer-read-only”, change all the value to nil, then byte compile and reload it, things will be right now.

This solution surely is not very good. The compile buffer should be read only after things is displayed. I don’t know whether this is the problem of JDEE or of emacs, but since I can get things done now, it’s OK. Hope to find better solution later.

Tags: