[ Forwarded to vim-dev, as requested by Bram. Consider both the patch
  and the suggested default change as RFCs ]

Hi Bram,
  could you please consider the attached patch for filetype.vim? It
provides better recognition of 'tex' filetypes against 'plaintex' ones.
It looks for sectioning commands that are specific to latex (\part,
\section, \paragraph, ...).

Also, according to a comment in filetype.vim, the code distinguishing
between 'tex' and 'plaintex' should default to 'tex', whereas, according
to these lines:

    " Default value, may be changed later:
    let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'

I assume it defaults to 'plaintex'. Is there a reason for that or it is
just a typo? I found the default to 'tex' much more reasonable, as most
of people write latex these days ...

What about changing it so that it matches the comment?

Many thanks in advance,
Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
[EMAIL PROTECTED],debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-
Index: vim/runtime/filetype.vim
===================================================================
--- vim/runtime/filetype.vim.orig
+++ vim/runtime/filetype.vim
@@ -1769,7 +1769,7 @@
     call cursor(1,1)
     let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
     if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
-      let lpat = 
'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
+      let lpat = 
'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>|part\>|chapter\>|section\>|subsection\>|subsubsection\>|paragraph\>|subparagraph\>|subsubparagraph'
       let cpat = 
'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
       let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
                              \ 'cnp', firstNC + 1000)

Attachment: signature.asc
Description: Digital signature

Reply via email to