unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Processing Chinese Big5 in Emacs Info reader
@ 2004-01-18  5:23 Chun-Chieh Huang
  2004-01-18  6:52 ` Eli Zaretskii
  2004-01-18 16:16 ` Chun-Chieh Huang
  0 siblings, 2 replies; 4+ messages in thread
From: Chun-Chieh Huang @ 2004-01-18  5:23 UTC (permalink / raw)


Dear all,

I don't know current policy of FSF for supporting Chinese Big5 in its
Info/Texinfo utilities. But I did a quick fix to read Chinese Big5 in
Emacs Info reader. BTW, if I converted my texinfo files to Info by
texinfo-format-buffer command in Texinfo-mode, I can process Chinese
Big5 too. Makeinfo, however, can't process Chinese Big5 correctly. So
maybe the Chinese translation team in FSF can use Emacs to process
Texinfo and Info. 

I only changed one line in info.el to support Big5 Info reading in
Emacs, as below: (info.el from CVS)

[jjhuang@albert-laptop lisp]$ diff info.el.~1.376.~ info.el
343c343,344
<               (coding-system-for-write 'no-conversion)
---
> ;;            (coding-system-for-write 'no-conversion)
>               (coding-system-for-write 'buffer-file-coding-system)

But I only test it on my GNU Emacs 21.3.1 (i386-mandrake-linux-gnu, X
toolkit, Xaw3d scroll bars) of 2003-08-27 on ke.mandrakesoft.com,
modified by Mandrake. It works fine. Finally, I can edit some Texinfo
files and convert them into Info, and read it in Emacs. Usually the
Chinese Big5 users would change buffer-file-coding-system to
chinese-big5, so this is a quick fix only. :-)


Chun-Chieh
-- 
Chun-Chieh Huang, aka Albert    E-mail: jjhuang AT cm.nctu.edu.tw
黃俊傑                         
Department of Computer Science  
National Tsing Hua University   MIME/ASCII/PDF/PostScript are welcome!
HsinChu, Taiwan                 NO MS WORD DOC FILE, PLEASE!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Processing Chinese Big5 in Emacs Info reader
  2004-01-18  5:23 Processing Chinese Big5 in Emacs Info reader Chun-Chieh Huang
@ 2004-01-18  6:52 ` Eli Zaretskii
  2004-01-18 15:28   ` Chun-Chieh Huang
  2004-01-18 16:16 ` Chun-Chieh Huang
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2004-01-18  6:52 UTC (permalink / raw)
  Cc: karl, emacs-devel

> From: Chun-Chieh Huang <jjhuang@cm.nctu.edu.tw>
> Date: Sun, 18 Jan 2004 13:23:51 +0800
> 
> I only changed one line in info.el to support Big5 Info reading in
> Emacs, as below: (info.el from CVS)
> 
> [jjhuang@albert-laptop lisp]$ diff info.el.~1.376.~ info.el
> 343c343,344
> <               (coding-system-for-write 'no-conversion)
> ---
> > ;;            (coding-system-for-write 'no-conversion)
> >               (coding-system-for-write 'buffer-file-coding-system)

Thanks.

However, I wonder why did this work for you at all, and why the
original code didn't.

Are your Info files kept compressed on the disk, and if so, in what
format?  The part of code that you changed is only run for compressed
Info files and doesn't change a bit the case of uncompressed Info
files.

On the other hand, coding-system-for-write is set to no-conversion
because it is used to write the compressed file to a temporary file
that is submitted to a decoder program, such as unzip or bunzip2;
clearly, writing compressed text with any other value for
coding-system-for-write is looking for trouble.  Binding
coding-system-for-read, which is used to read back the results of
decompression, is more appropriate, but Emacs should already set that
correctly by itself, at least in the locale where Big5 is the
preferred encoding.

So I'm confused how could this change solve your problem, and even
what is the problem (i.e. what happens if you use the original
info.el).  Could you please elaborate to show me what I'm missing?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Processing Chinese Big5 in Emacs Info reader
  2004-01-18  6:52 ` Eli Zaretskii
@ 2004-01-18 15:28   ` Chun-Chieh Huang
  0 siblings, 0 replies; 4+ messages in thread
From: Chun-Chieh Huang @ 2004-01-18 15:28 UTC (permalink / raw)
  Cc: karl, emacs-devel

Eli Zaretskii <eliz@elta.co.il> writes:

> Thanks.
>
> However, I wonder why did this work for you at all, and why the
> original code didn't.
>
> Are your Info files kept compressed on the disk, and if so, in what
> format?  The part of code that you changed is only run for compressed
> Info files and doesn't change a bit the case of uncompressed Info
> files.
[stuff deleted]
> So I'm confused how could this change solve your problem, and even
> what is the problem (i.e. what happens if you use the original
> info.el).  Could you please elaborate to show me what I'm missing?

After you said that, I'm confused too. My Info file is not
compressed. I put a test info file on my web page, which is
http://cmbsd.cm.nctu.edu.tw/~jjhuang/files/test.info

I used GNU Emacs for many years, but to Emacs Lisp programming, I'm
only a rookie. When I read Big5 Info file for testing purpose, I saw
undecoded 8bit sequences on my screen. Logically, I guess that's
because wrong coding system in info buffer. So I search info.el for
any coding-system settings, I found only one,
i.e. coding-system-for-write, and I changed it, then it works. The
story is that simple, I didn't trace any code. :-)
-- 
Chun-Chieh Huang, aka Albert    E-mail: jjhuang AT cm.nctu.edu.tw
黃俊傑                         
Department of Computer Science  
National Tsing Hua University   MIME/ASCII/PDF/PostScript are welcome!
HsinChu, Taiwan                 NO MS WORD DOC FILE, PLEASE!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Processing Chinese Big5 in Emacs Info reader
  2004-01-18  5:23 Processing Chinese Big5 in Emacs Info reader Chun-Chieh Huang
  2004-01-18  6:52 ` Eli Zaretskii
@ 2004-01-18 16:16 ` Chun-Chieh Huang
  1 sibling, 0 replies; 4+ messages in thread
From: Chun-Chieh Huang @ 2004-01-18 16:16 UTC (permalink / raw)


Chun-Chieh Huang <jjhuang@cm.nctu.edu.tw> writes:

> Dear all,
>
> I only changed one line in info.el to support Big5 Info reading in
> Emacs, as below: (info.el from CVS)

Please don't commit this change. I made a mistake.

I found when I first enter Info buffer, I can see any Big5 Info
file. But after I read an ASCII Info file, Big5 characters become 8bit
sequences. After changing the code, I byte-compile info.el again,
restart Info-mode, and then I saw Big5 characters. It's not because I
changed the code, it works because I restarted it. Sorry for my
mistake. Next time I will do extensive tests before I post.

-- 
Chun-Chieh Huang, aka Albert    E-mail: jjhuang AT cm.nctu.edu.tw
黃俊傑                         
Department of Computer Science  
National Tsing Hua University   MIME/ASCII/PDF/PostScript are welcome!
HsinChu, Taiwan                 NO MS WORD DOC FILE, PLEASE!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-18 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-18  5:23 Processing Chinese Big5 in Emacs Info reader Chun-Chieh Huang
2004-01-18  6:52 ` Eli Zaretskii
2004-01-18 15:28   ` Chun-Chieh Huang
2004-01-18 16:16 ` Chun-Chieh Huang

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).