Tony Mechelynck wrote:

> >> When I try to view a *.rdf file, for instance the attached install.rdf
> >> from the ChatZilla extension to Firefox or SeaMonkey, Vim sets "redif"
> >> filetype and displays everything after the XML header in black on red
> >> (highlight group redifIncorrectBeginningOfFile, linking to Error). In
> >> order to clear the error (and since there is no specific syntax for
> >> RDF/XML), I have to set the filetype manually to XML.
> >>
> >> Strangely enough, there is no syntax script for redif: all syntax
> >> commands for that syntax are in the filetype-plugin, which is incorrect
> >> procedure by Vim standards. In fact, AFAICT,
> >> $VIMRUNTIME/ftplugin/redif.vim is actually a syntax script, not a
> >> filetype-plugin, and ought to be in syntax/ instead of in ftplugin/.
> >
> > Sorry, somehow I managed to put the file in the wrong directory.
> >
> >> What should I do? What should other users like me do in order to have
> >> their RDF files correctly identified as XML-serialized Resource
> >> Description Framework manifests and not as whatever "redif" might be?
> >
> > Apparently your .rdf file is not redif.  So we need a better way to
> > detect the filetype.
> >
> > It appears that redif uses # comments, while your .rdf file looks like
> > XML, thus lots of <>.  That could be used.
> >
> Yes, RDF/XML (as described in the Wikipedia and W3C links in my previous 
> post) can be regarded as a subtype of XML. In particular it starts with 
> <?xml (a UTF-8 BOM might be acceptable before that, I haven't boned up 
> that far on the standard) and it uses the same <!-- comments --> as XML 
> et al. The corresponding MIME type is application/rdf+xml

I think it would work to detect a .rdf file as redif after scripts.vim
has been used to check for XML.

> Thanks Bram! After the update, the file is recognised as ft=xml, which 
> is the best we can do AFAIK.
> 
> BTW, it seems that "make install" over an existing installation of Vim 
> doesn't remove files which have been removed (or moved away) on 
> Mercurial. I've deleted $VIMRUNTIME/ftplugin/redif.vim manually. (The 
> script still exists as $VIMRUNTIME/syntax/redif.vim)
> 
> Maybe one of these days I should do
>       rm -Rvf /usr/local/share/vim/vim73
>       make install

Deleting everything is a bit dangerous.  Since a mistake like this would
happen very infrequently let's just leave it.

-- 
Never eat yellow snow.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui