March 23, 2004

Japanese files in Emacs

Emacs must be compiled with leim or it will not have extra input modes.

If you are not in X you will likely not be able to use Japanese (I’m sure there is more to it than this, if you care to enlighten me, I’ll be glad) Type C-h h to view the hello file which tells you how to say hello in many languages. See if you can see Japanese here.

set language environment with: M-x set-language-environment - Japanese or C-x RET l - Japanese

Once the language environment is set to Japanese it is quite easy to select the japanese input method, and Emacs will often be able to automatically detect what “Coding System” (Shift-jis, euc-jp, etc.) your Japanese page is encoded in.

” The `set-locale-environment’ function normally uses the preferred
coding system established by the language environment to decode system
messages. But if your locale matches an entry in the variable
`locale-preferred-coding-systems’, Emacs uses the corresponding coding
system instead. For example, if the locale `ja_JP.PCK’ matches
`japanese-shift-jis’ in `locale-preferred-coding-systems’, Emacs uses
that encoding even though it might normally use `japanese-iso-8bit’.

You can override the language environment chosen at startup with
explicit use of the command `set-language-environment’, or with
customization of `current-language-environment’ in your init file.

To display information about the effects of a certain language
environment LANG-ENV, use the command `C-h L LANG-ENV <RET>’
(`describe-language-environment’). This tells you which languages this
language environment is useful for, and lists the character sets,
coding systems, and input methods that go with it. It also shows some
sample text to illustrate scripts used in this language environment.
By default, this command describes the chosen language environment.”

To enable or disable default input method: C-\

The command `C-h C’ (`describe-coding-system’) displays information
about particular coding systems.

To display a list of all the supported coding systems, type `M-x
list-coding-systems’.

“If Emacs recognizes the encoding of a file incorrectly, you can
reread the file using the correct coding system by typing `C-x <RET> c
CODING-SYSTEM <RET> M-x revert-buffer ’. To see what coding
system Emacs actually used to decode the file, look at the coding
system mnemonic letter near the left edge of the mode line , or type `C-h C <RET>’.”

———

“In cases where Emacs does not automatically choose the right coding
system, you can use these commands to specify one:

`C-x <RET> f CODING <RET>’
Use coding system CODING for the visited file in the current
buffer.

`C-x <RET> c CODING <RET>’
Specify coding system CODING for the immediately following command.”

Posted by ultrabob at 12:56 AM | Comments (1)

March 09, 2004

FreeBSD kernel config for sound Toshiba Dynabook Satellite 1800 SA10AP/4

I have a Toshiba Dynabook Satellite 1800 SA10AP/4 laptop (Japan only model I think), and I have installed FreeBSD 4.9 on it. I was recompiling the kernel to enable sound (by adding options pcm), and it kept failing on startup with an error. (I'll try to find what the error was and put it up here soon) Anyway the solution was to go into the bios and turn off plug and play only the bios in Toshiba doesn't call is plug and play, it calls it device configuration.

To get into bios hold down the esc key while the machine boots, and when prompted press the F1 key. Press Page Down to get to the second page of options and select All Devices instead of Selected by OS. Press end to save and exit, and it should boot fine with sound.

I'll try to come back and rewrite this a little later, but I thought I'd better get this info up right away before I forget, and so it will be available for people with the same problem.

Posted by ultrabob at 09:10 PM | Comments (0)