help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to show file encode under emacs


From: Peter Dyballa
Subject: Re: how to show file encode under emacs
Date: Wed, 19 Dec 2007 11:04:59 +0100


Am 19.12.2007 um 04:27 schrieb chandle.wei:

I'm use unicad.el that an elisp port of Mozilla Universal Charset Auto
Detector .

I don't know that file. And I don't know what it can do better then existing code in GNU Emacs. Have you read in *info* buffer the "Recognize Coding" node? And some more on encoding issues? Or about the "Mode Line"?

I just want show detectored encode like (utf-8 gb2312 shfit-jfs) under
bottom bar .

What is that "bottom bar"? The dock?

how to do it

Here is an excerpt form the HELLO buffer (C-h H):

Kannada (ಕನನಡ)                  ನಮಸಕಾರ
Lao (ພາສາລາວ) ສະບາຍດ, ຂໃຫໂຊກດ
Malayalam (മലയാളം)              നമസകാരം
Maltese (il-Malti)              Bonġu, Saħħa
Mathematics                     ∀ p ∈ world • hello p  □
-UUJ:%%--F1 HELLO Top (1,0) (Fundamental View)----Mi, 19. Dez 2007 10:17 0.36----

The mode-line starts, at the left, with - and then, only when used in a terminal emulation or a real terminal, come three characters that describe encoding parameters (in a windowing environment only one character is used), I think it's Unicode (UTF-8) for input and output encoding operations and then the J stands for iso-2022-7bit encoding used for the file visiting the buffer. You can get explanation for these "remarks" with M-x describe-coding-system (or C-h C) and then RET to choose information for this buffer. In a windowing environment you can simply click with the mouse (left) onto the character and a *Help* buffer opens to explain – I think you'll need an up-to-date version 22.x of GNU Emacs.


If you're asking how to integrate output of unicad.el into mode-line: I don't know, because I don't know that file and what it does and how it outputs/provides information. Anyway, you can customise mode-line:

        Options menu -> Customize Emacs -> Specific Option...

and enter:

        m o d e - <TAB>

then choose mode-line-format. You'll see:

(#("-" 0 1
(help-echo "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")) mode-line-mule-info mode-line-modified mode-line-frame- identification mode-line-buffer-identification

The important term is the variable mode-line-mule-info. You might consider to substitute it with something else, from unicad.el. You might also, and maybe better, consider to add something coming from unicad.el somewhere else to mode-line ...

--
Greetings

  Pete

Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
                                – Georges W. Bush







reply via email to

[Prev in Thread] Current Thread [Next in Thread]