# ELM Mail files
elseif line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
+ || line1 =~ '^\creturn-path:\s<.*@.*>$'
setl ft=mail
# Mason
elseif line1 =~ '^#n\%($\|\s\)'
setl ft=sed
+ elseif line1 =~ '^#\s\+Reconstructed via infocmp from file:'
+ setl ft=terminfo
+
+ elseif line1 =~ '^File: .*\.info, Node: .*, \%(Next\|Prev\): .*, Up: \|This is the top of the INFO tree.'
+ setl ft=info
+
else
var lnum = 1
while getline(lnum) =~ "^? " && lnum < line("$")
filetype off
endfunc
+func Test_info_file()
+ filetype on
+
+ call writefile(['File: coreutils.info, Node: Top, Next: Introduction, Up: (dir)', 'D'], 'Xfile', 'D')
+ split Xfile
+ call assert_equal('info', &filetype)
+ bwipe!
+
+ filetype off
+endfunc
+
+func Test_mail_file()
+ filetype on
+
+ call writefile(['Return-path: <lgc@debian.home.arpa>', 'D'], 'Xfile', 'D')
+ split Xfile
+ call assert_equal('mail', &filetype)
+ bwipe!
+
+ filetype off
+endfunc
+
+func Test_terminfo_file()
+ filetype on
+
+ call writefile(['# Reconstructed via infocmp from file: /etc/terminfo/x/xterm', 'D'], 'Xfile', 'D')
+ split Xfile
+ call assert_equal('terminfo', &filetype)
+ bwipe!
+
+ filetype off
+endfunc
+
" Filetypes detected from names of existing files
func Test_pacmanlog()
filetype on