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

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

Re: Is it possible to use new Emacsen with non-ASCII?


From: Ilya Zakharevich
Subject: Re: Is it possible to use new Emacsen with non-ASCII?
Date: Fri, 23 May 2008 09:55:34 +0000 (UTC)
User-agent: trn [how to get a version via %-escapes???] with a custom header

[A complimentary Cc of this posting was sent to
Jason Rumney 
<jasonrumney@gmail.com>], who wrote in article 
<bc82e254-8f58-4f79-9184-aecc6f65eabb@e53g2000hsa.googlegroups.com>:
> Coding systems all have names that are lower-case. Interactively the
> completion code will take care of the case conversion on input, but
> programatically you'll have to downcase v before interning.
> 
> This will work for the Cyrillic-KOI8 language environment, and for a
> few others where the language environment name matches the prefered
> coding-system or an alias, but if you are looking for a more general
> mechanism, I'd recommend using (car (get-language-info v 'coding-
> priority)) as a more robust way to get the coding system from the
> language environment. The downcase method will fail for language
> environments like "Tajik", which specifes koi8-t as its prefered
> coding-system (also "French", "German" etc which specify iso-latin-1).

Confirmed to work (both with unibyte mode, and without).  The current
code is

(let (vv (v (getenv "EMACS_LANGENV")))
  (and v (progn
           (set-language-environment v)
           (setq vv (car (get-language-info v 'coding-priority)))
           (set-terminal-coding-system vv)
           (set-keyboard-coding-system vv)
           (set-input-mode (car (current-input-mode))
                           (nth 1 (current-input-mode))
                           '8bit)
           (run-with-idle-timer
            5 nil 'message              ; Once, after 5 sec of inactivity
            "Switch Cyr/Lat by Ctrl-\\, Cyr-Yawerty/Cyr-GOST by f9 \\"))))

However, it become harder and harder to document as "a solution"...

Thanks,
Ilya



reply via email to

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