jump to navigation

Junk characters in Emacs January 30, 2006

Posted by Chen Yufei in Emacs.

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. These junk characters should be something related to the colors.


Emacs 23 and unicode support January 16, 2006

Posted by Chen Yufei in Emacs.
add a comment

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!

JDEE compile time error: “buffer is read only” January 12, 2006

Posted by Chen Yufei in Emacs.
1 comment so far

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.