On 06/04/13 13:58, Bram Moolenaar wrote:

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


changeset:   4587:a079ef0ce001
user:        Bram Moolenaar <[email protected]>
date:        Sat Apr 06 17:26:26 2013 +0200
files: runtime/doc/todo.txt runtime/filetype.vim runtime/ftplugin/redif.vim runtime/syntax/redif.vim
description:
Move redif syntax file to the right directory.
Disable recognizing .rdf as a redif file.

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

Best regards,
Tony.
--
Hand, n.:
        A singular instrument worn at the end of a human arm and
commonly thrust into somebody's pocket.
                -- Ambrose Bierce, "The Devil's Dictionary"

--
--
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