What to do with heredoc in dosini tip?

8 views
Skip to first unread message

Ben Fritz

unread,
Feb 1, 2009, 3:20:43 PM2/1/09
to vim_use
We have a tip, created in July, which we are just getting around to
deciding what to do with:

http://vim.wikia.com/wiki/Syntax_heredoc_highlighting_for_dosini

As I said in the discussion when the tip was first submitted, "if
dosini (whatever it is) actually does support heredoc, this should be
submitted on vim_dev and to the syntax maintainer as a patch, rather
than as a tip here."

If I understand correctly, "dosini" refers to DOS-style init files,
with the ".ini" extension.

I know pretty much nothing else about this syntax.

So, does dosini support heredoc-style assignments? The tip seems to
imply that *many* but not *all* programs that use .ini files can
support, so perhaps it would be better as a tip than an official part
of the syntax file. But I'd like to get input from those that know
more about this before proceeding.

Matt Wozniski

unread,
Feb 1, 2009, 4:46:34 PM2/1/09
to vim...@googlegroups.com
On Sun, Feb 1, 2009 at 3:20 PM, Ben Fritz wrote:
>
> We have a tip, created in July, which we are just getting around to
> deciding what to do with:
>
> http://vim.wikia.com/wiki/Syntax_heredoc_highlighting_for_dosini
>
> As I said in the discussion when the tip was first submitted, "if
> dosini (whatever it is) actually does support heredoc, this should be
> submitted on vim_dev and to the syntax maintainer as a patch, rather
> than as a tip here."
>
> If I understand correctly, "dosini" refers to DOS-style init files,
> with the ".ini" extension.
>
> I know pretty much nothing else about this syntax.

Right... it's not exactly the most standardized format out there.
Some parsers support quoted RHS, others don't. It wouldn't shock me
if some support heredocs, but for the ones that do, is "dosini" really
the best filetype name? DOS doesn't support heredocs AFAIR, and .ini
is used on other systems than DOS as an easily-parseable format...
Maybe "dosini.vim" should be moved to "ini.vim", since it is used on
non-dos systems? Is there any precedent for renaming a filetype?

> So, does dosini support heredoc-style assignments? The tip seems to
> imply that *many* but not *all* programs that use .ini files can
> support, so perhaps it would be better as a tip than an official part
> of the syntax file. But I'd like to get input from those that know
> more about this before proceeding.

Well... how much harm is there in including it even if it isn't
supported? It would only affect people who assign a variable a value
matching /<<\(\I\i*\)/ - wouldn't it be safe to assume that no one
would do that unless they knew the file would be parsed by something
supporting heredocs?

~Matt

Ben Schmidt

unread,
Feb 1, 2009, 8:55:46 PM2/1/09
to vim...@googlegroups.com
>> http://vim.wikia.com/wiki/Syntax_heredoc_highlighting_for_dosini

>>
> Right... it's not exactly the most standardized format out there.

I agree. It's a mess.

> Some parsers support quoted RHS, others don't. It wouldn't shock me
> if some support heredocs, but for the ones that do, is "dosini" really
> the best filetype name? DOS doesn't support heredocs AFAIR, and .ini
> is used on other systems than DOS as an easily-parseable format...
> Maybe "dosini.vim" should be moved to "ini.vim", since it is used on
> non-dos systems? Is there any precedent for renaming a filetype?

My memory matches yours regarding DOS, etc. I don't know of a precedent,
for a name change but I think such a change would make sense in this
case. It probably shouldn't have, but the .ini format has spread like a
virus to all kinds of areas.

> Well... how much harm is there in including it even if it isn't
> supported? It would only affect people who assign a variable a value
> matching /<<\(\I\i*\)/ - wouldn't it be safe to assume that no one
> would do that unless they knew the file would be parsed by something
> supporting heredocs?

I think so.

Ben.

Tony Mechelynck

unread,
Feb 1, 2009, 9:49:03 PM2/1/09
to vim...@googlegroups.com
On 02/02/09 02:55, Ben Schmidt wrote:
>>> http://vim.wikia.com/wiki/Syntax_heredoc_highlighting_for_dosini
>>>
>> Right... it's not exactly the most standardized format out there.
>
> I agree. It's a mess.
>
>> Some parsers support quoted RHS, others don't. It wouldn't shock me
>> if some support heredocs, but for the ones that do, is "dosini" really
>> the best filetype name? DOS doesn't support heredocs AFAIR, and .ini
>> is used on other systems than DOS as an easily-parseable format...
>> Maybe "dosini.vim" should be moved to "ini.vim", since it is used on
>> non-dos systems? Is there any precedent for renaming a filetype?
>
> My memory matches yours regarding DOS, etc. I don't know of a precedent,
> for a name change but I think such a change would make sense in this
> case. It probably shouldn't have, but the .ini format has spread like a
> virus to all kinds of areas.

What about backwards compatibility? With, for instance, users having
~/.vim/after/ftplugin/dosini.vim (and/or syntax/dosini.vim,
indent/dosini.vim) or files with other extensions having ft=dosini in a
Vim modeline?

Or else, keep the existing dosini.vim scripts and define a new "ini"
filetype with different scripts, the detection (and identification of
which is which) being done maybe automatically (by inspecting the file's
contents) or maybe manually (by a global variable -- undefined would
mean keep the current behaviour)?

The new scripts could even source the old ones (and extend them) the way
cpp.vim does with c.vim

>
>> Well... how much harm is there in including it even if it isn't
>> supported? It would only affect people who assign a variable a value
>> matching /<<\(\I\i*\)/ - wouldn't it be safe to assume that no one
>> would do that unless they knew the file would be parsed by something
>> supporting heredocs?
>
> I think so.
>
> Ben.

or those who include that kind of text in a comment?

Best regards,
Tony.
--
The streets are safe in Philadelphia, it's only the people who make
them unsafe.
-- Mayor Frank Rizzo

Reply all
Reply to author
Forward
0 new messages