有了xft后emacs的字体设置,解决新开frame还是老字体的问题

March 17th, 2008 | Posted in Emacs   Add Comment

有了xft以后emacs的字体设置现在已经可以简单到不能简单了,而且很漂亮,真的很养眼。
其实这个设置也没什么特别的,主要是今天在emacs@newsmth上看到有人问新开frame仍然使用的是老字体的问题,想起自己当初因为这个琢磨了很久emacs的font是怎么搞的,所以应该还是有必要发出来共享一下的


(progn
(set-default-font "courier 10 pitch-12")
(set-fontset-font "fontset-default" 'han '("微软雅黑" . "unicode-bmp"))
(add-to-list 'default-frame-alist '(font . "courier 10 pitch-12")))

progn那个可以去掉的,我当初是为了测试方便能够一起eval三句用的
我不会创建fontset,所以先set-default-font来设置默认字体,这个会自动创建一个fontset
然后修改这个fontset来增加中文显示字体
最后把这个fontset加到default-frame-alist,因为新开的frame会从default-frame-alist里继承,也就继承了字体的设置

Seems scim conflicts with Xorg or sawfish or emacs?

March 9th, 2007 | Posted in Emacs   1 Comment

I first found this problem when using ubuntu dapper & emacs 23.0.0.1.

Sometimes when speedbar is started in emacs, every key press in emacs does not effects unless next time I switched to emacs.

At first, I thought it was a little bug with emacs 23, so I did not take it serious.

But after upgrading to feisty & emacs 23.0.0.9, this happens more often. When created a new frame, either speedbar or C+X 5 2, key press frozen. And everything returns all right when all other frames are closed. And evem more, key press lags when switching windows! So I thought it maybe bug with xorg or sawfish!
So I asked in emacs@newsmth, and someone said it maybe problem between xim & emacs in reply. Then I disabled scim and now seems everything ok.