<<< Date Index >>>     <<< Thread Index >>>

Re: Emacs opening post files as latin-1 and the rest as UTF-8



On Wednesday 2007-01-10 18:13:36 +0100, Ismael Valladolid Torres wrote:
> I am running Debian testing with the mutt and emacs21 packages
> installed (then they are Mutt 1.5.13 and GNU Emacs 21.4.1).
> 
> In my .emacs there's the following:
> 
> (set-locale-environment (getenv "LANG"))
> 
> Where before I had this which also gave the same problem:
> 
> (when (string-match "UTF-8" (getenv "LANG"))
>   (set-language-environment "UTF-8"))
> 
> What I am trying to achieve is for emacs to open any new file or
> existing file editing it in the UTF-8 language environment ("u" must
> be showed in the lower left corner of emacs). This works for any file
> except when I go to mutt and create a new mail or reply to an existing
> one. Then the file "/tmp/mutt-blahblah" is opened for editing in
> latin-1 mode ("1" is on my lower left corner then). Which is a mess as
> many of them are in spanish and UTF-8 special characters appear
> mangled in the post being edited.
> 
> What can be making Emacs not to change the language environment when
> opening a mutt temporal post file?
> 
> Elisp packages installed are:
> 
> emacs-goodies-el                                install
> post-el                                         install
> 

Hi Ismael.

I'll say it could be post-el fault.
Maybe it's changing the coding system when setting the mail
mode (or maybe some other specialized post-mode).

Try to check the mail-mode-hook or an eventual post-mode-hook variables
to see if they mess up the language environment/encoding, and/or try
to disable post-el to see if it works correctly without.

Or you could try to force the encoding when opening mail files with
something as:

(add-hook 'mail-mode-hook '(setq buffer-file-coding-system 'mule-utf-8))

HTH
--
Stefano