Showing posts with label Emacs. Show all posts
Showing posts with label Emacs. Show all posts

Saturday, April 28, 2007

Restore Emacs Meta Key in FreeBSD

When working under FreeBSD console at a PC, I cannot use ALT as META key in the Emacs. It means the Alt key is uneffective. Thus, I had to press ESC then X to input Emacs commands. It is such a trouble than I often press wrongly. Now there is a method to use ALT as META function, Just use the tool kbdcontrol to load the emacs keyboard map, us.emacs.kbd.
kbdcontrol -l us.emacs

Monday, March 05, 2007

Compile your emacs 23 (unicode-2 branch) with XFT support

The current stable version of emacs is 21. Although Emacs 21 presents upstanding, more or less boring problems still exist in chinese charactors and input support. Fortunately, we have another better choice, that is emacs 23, typically named emacs-unicode-2, which is a unicode branch of the currently developping version 23. Emacs23 commendably supports chinese display and input methods.

Fristly, we should get the lastest sources from cvs depository:

$ set CVS_RSH="ssh"
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co -r emacs-unicode-2 emacs

Emacs23 support xft fonts, which maybe is the most exciting feature. To support xft, you should add compile condition --enable-font-backend, such as:

$ ./configure --enable-font-backend
$ make bootstrap
$ sudo make install

If you use debian or ubuntu, maybe you should get some header files used for compiler. If gentoo, maybe all is ready for you.

$ sudo apt-get install xserver-xorg-dev xorg-dev libfontconfig-dev libfreetype-dev libxft-dev

After emacs installed, configure ~/.emacs:

;;{{{ XFT Fonts Setting
(set-default-font "Consolas-16")
(set-fontset-font (frame-parameter nil 'font)
                      'han '("Vera Sans YuanTi" . "unicode-bmp"))
;;}}}

Use the command blew to get xft support for emacs:

$ emacs --enable-font-backend