Bug#517532: vim: au FileType mail doesn't work anymore?

Kurt Roeckx kurt at roeckx.be
Sat Feb 28 17:26:13 UTC 2009


On Sat, Feb 28, 2009 at 11:09:21AM -0500, James Vega wrote:
> On Sat, Feb 28, 2009 at 01:46:22PM +0100, Kurt Roeckx wrote:
> > Because of #379107 I have this in my vimrc file:
> > :let &termencoding = &encoding
> > set encoding=utf-8
> > au FileType mail setlocal fenc=latin1
> >
> > However that doesn't seem to work anymore, and the fileencoding is now 
> > set to utf-8 instead of latin1.
> 
> From a quick test, using an autocmd to set 'fenc' to latin1 works for
> me.  Could you try ":verbose set fenc?" from the mail file?

It says utf-8.  I've looked at that before sending that mail.

> > I also wanted to set other options for mail now, but it doesn't seem to 
> > have any effect.  So my guess was that detections of the filetype was 
> > broken.  I use mutt so my files look like  
> > /tmp/mutt-intrepid-1000-28242-16.
> 
> Testing in my Lenny chroot, that file pattern does get recognized as
> 'mail' filetype.  ":verbose set filetype?" will show what filetype it is
> set to and which script set it.

I get:
  filetype=

It seems it doesn't recoginize any filetype.

I have this installed:
vim 1:7.1.314-3+lenny2
vim-common 1:7.1.314-3+lenny2
vim-runtime 1:7.1.314-3+lenny2

And my alternatives:
/etc/alternatives/vi -> /usr/bin/vim.basic
/etc/alternatives/vim -> /usr/bin/vim.basic

> > But I also just tried "set fenc=latin1" in my vimrc file, but that 
> > doesn't seem to have any effect when editing non-empty files either, it 
> > only seems to have an effect on empty files.  If the file already has 
> > ascii text in it, it will always set fenc to utf-8 it seems.
> 
> From :help 'fenc
> 
>   When reading a file 'fileencoding' will be set from 'fileencodings'.
>   To read a file in a certain encoding it won't work by setting
>   'fileencoding', use the |++enc| argument.  One exception: when
>   'fileencodings' is empty the value of 'fileencoding' is used.
>   For a new file the global value of 'fileencoding' is used.

I don't care about which encoding it's using when reading.  I care
about the encoding it's going to use when writing.  You can perfectly
open an utf-8 file, change fenc, and then write a latin1 file.


Kurt






More information about the pkg-vim-maintainers mailing list