Update ftplugin/ocaml.vim

137 views
Skip to first unread message

Hirotaka Hamada

unread,
Jul 21, 2013, 12:27:52 PM7/21/13
to vim...@vim.org, Br...@moolenaar.net, markus...@gmail.com
Hi,

I have updated ftplugin/ocaml.vim.

1) use buffer-local mapping instead of global one
2) provide <Plug>
3) remove iabbrev (I think this is user specific setting.)

Please check this patch.

Regards.

----------
Hirotaka Hamada <hirotaka.h...@gmail.com>
fix-ocaml.diff

Bram Moolenaar

unread,
Jul 22, 2013, 4:50:39 PM7/22/13
to Markus Mottl, Hirotaka Hamada, vim...@vim.org


Markus Mottl wrote:

> Hi Hirotaka,
>
> thanks for the patches, I have applied them to my files.
>
> What is actually the best way to contribute updates to the Vim
> maintainers these days? I see you have switched to Mercurial, which
> is great, because I'm also an avid user. Is there a way to submit
> pull requests? I don't know much about the workflow on Google Code.
> I have moved all my repositories to Bitbucket a long time ago, because
> it made project management with Mercurial shockingly easy.

Just email the update file to me. Then it's easy for me to check for
any differences (and sometimes catch changes already in the distribution
that didn't flow back to the maintainer). I also run a script to check
for mistakes before submitting the updated files.

--
hundred-and-one symptoms of being an internet addict:
10. And even your night dreams are in HTML.

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///

Markus Mottl

unread,
Jul 22, 2013, 4:49:43 PM7/22/13
to Hirotaka Hamada, vim...@vim.org, Bram Moolenaar
Hirotaka,

I had to undo part of the patch. There seems to be a strange
performance problem with the <Plug> version of OCamlSwitch. Switching
becomes really slow with it.

Please refer to my Bitbucket repository (not a clone of the
Vim-repository) for the latest files, which do seem to work as usual.
Maybe you can find out what's going on:

https://bitbucket.org/mmottl/vim-files

Regards,
Markus
--
Markus Mottl http://www.ocaml.info markus...@gmail.com

Markus Mottl

unread,
Jul 22, 2013, 5:10:09 PM7/22/13
to Bram Moolenaar, Hirotaka Hamada, vim...@vim.org
Ok, I'll send you the latest files once some minor issues have been
worked out. I'll use your Mercurial repository in the future to make
sure that I'm working with the latest version of all files.

Would it improve your workflow if I cloned the Vim-repository on
Bitbucket and sent you an email with the appropriate pull command
whenever new files should be released? That way you could use
Mercurial right off the bat to deal with my incoming patches.

Regards,
Markus

Bram Moolenaar

unread,
Jul 24, 2013, 6:06:44 AM7/24/13
to Markus Mottl, Hirotaka Hamada, vim...@vim.org

Markus Mottl wrote:

> Ok, I'll send you the latest files once some minor issues have been
> worked out. I'll use your Mercurial repository in the future to make
> sure that I'm working with the latest version of all files.
>
> Would it improve your workflow if I cloned the Vim-repository on
> Bitbucket and sent you an email with the appropriate pull command
> whenever new files should be released? That way you could use
> Mercurial right off the bat to deal with my incoming patches.

No, that makes things more complicated. I use Mercurial for
distribution, not for including patches.

--
hundred-and-one symptoms of being an internet addict:
18. Your wife drapes a blond wig over your monitor to remind you of what she
looks like.

Markus Mottl

unread,
Jul 24, 2013, 10:11:10 AM7/24/13
to Bram Moolenaar, Hirotaka Hamada, vim...@vim.org
Bram,

I have attached a tarball containing the latest OCaml ftplugin and
syntax files. Thanks for your work!

Regards,
Markus
vim_ocaml.tar.bz2

Hirotaka Hamada

unread,
Jul 24, 2013, 10:12:07 AM7/24/13
to vim...@googlegroups.com, Hirotaka Hamada, vim...@vim.org, Bram Moolenaar
Hi, Markus.

>There seems to be a strange
> performance problem with the <Plug> version of OCamlSwitch.

I'm sorry for my incomplete patch.

This is not a performance problem, but a mapping problem.
<Plug>OCamlSwitch and <Plug>OCamlSwitchNewWin were started with same sequence of character. So Vim was waiting in a while to solve this ambiguous mapping.

This patch fixes this problem to rename <Plug>OCamlWitch to be unique.


2013年7月23日火曜日 5時49分43秒 UTC+9 Markus Mottl:
fix-ocamlswitch.diff

Hirotaka Hamada

unread,
Jul 24, 2013, 10:57:51 AM7/24/13
to Markus Mottl, Bram Moolenaar, vim...@vim.org
Hi, Markus.

I read your patch.
'errorformat' setting has been moved to compiler/ocaml.vim at latest version of Vim.

You need to update to the latest version of the source code.

And please consider that merging my another patch.

Regards.

----------
Hirotaka Hamada <hirotaka.h...@gmail.com>

2013/7/24 Markus Mottl <markus...@gmail.com>

Nikolay Pavlov

unread,
Jul 24, 2013, 11:13:44 AM7/24/13
to vim...@googlegroups.com, Hirotaka Hamada, Bram Moolenaar, vim...@vim.org


On Jul 24, 2013 6:12 PM, "Hirotaka Hamada" <hirotaka.h...@gmail.com> wrote:
>
> Hi, Markus.
>
> >There seems to be a strange
> > performance problem with the <Plug> version of OCamlSwitch.
>
> I'm sorry for my incomplete patch.
>
> This is not a performance problem, but a mapping problem.
> <Plug>OCamlSwitch and <Plug>OCamlSwitchNewWin were started with same sequence of character. So Vim was waiting in a while to solve this ambiguous mapping.
>
> This patch fixes this problem to rename <Plug>OCamlWitch to be unique.

AFAIR Ingo or maybe somebody else invented wrapping this in () to prevent such problems: i.e. you just use "<Plug>(OCamlSwitch)" and do not care whether or not one prefixes other as it is just not possible. Any suffix character should work though, as far as it is only present at the end and never in the middle: "<Plug>OCamlSwitch$" is just as good.

>
> 2013年7月23日火曜日 5時49分43秒 UTC+9 Markus Mottl:
> > Hirotaka,
> >
> >
> >
> > I had to undo part of the patch.  There seems to be a strange
> >
> > performance problem with the <Plug> version of OCamlSwitch.  Switching
> >
> > becomes really slow with it.
> >
> >
> >
> > Please refer to my Bitbucket repository (not a clone of the
> >
> > Vim-repository) for the latest files, which do seem to work as usual.
> >
> > Maybe you can find out what's going on:
> >
> >
> >
> >   https://bitbucket.org/mmottl/vim-files
> >
> >
> >
> > Regards,
> >
> > Markus
> >
> >
> >
> > On Sun, Jul 21, 2013 at 12:27 PM, Hirotaka Hamada
> >
> > <hirotaka.h...@gmail.com> wrote:
> >
> > > Hi,
> >
> > >
> >
> > > I have updated ftplugin/ocaml.vim.
> >
> > >
> >
> > > 1) use buffer-local mapping instead of global one
> >
> > > 2) provide <Plug>
> >
> > > 3) remove iabbrev (I think this is user specific setting.)
> >
> > >
> >
> > > Please check this patch.
> >
> > >
> >
> > > Regards.
> >
> > >
> >
> > > ----------
> >
> > > Hirotaka Hamada <hirotaka.h...@gmail.com>
> >
> >
> >
> >
> >
> >
> >
> > --
> >
> > Markus Mottl        http://www.ocaml.info        markus...@gmail.com
>

> --
> --
> 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 vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Markus Mottl

unread,
Jul 24, 2013, 11:16:03 AM7/24/13
to Hirotaka Hamada, Bram Moolenaar, vim...@vim.org
Thanks, Hirotaka, I didn't know that the error format had been moved
already. Bram, could you please remove the error format in the OCaml
ftplugin file I just sent, assuming that's the correct way to
structure things these days? Thanks!

Hirotaka, what other patch are you referring to? I've made all
changes, but commented out your "OCaml switch" mappings that use
<Plug>. If I use those, it takes almost a second for Vim to switch
between source files, which is unacceptably slow. I have no idea why
that happens (I'm using Vim 7.3.762 installed via MacPorts).

Regards,
Markus

Hirotaka Hamada

unread,
Jul 24, 2013, 11:47:53 AM7/24/13
to Markus Mottl, Bram Moolenaar, vim...@vim.org
Hi, Markus

I have already sent a patch but forgot to send your email address, sorry.
I send it again.

Regards
fix-ocamlswitch.diff

Markus Mottl

unread,
Jul 24, 2013, 1:10:47 PM7/24/13
to Hirotaka Hamada, Bram Moolenaar, vim...@vim.org
Thanks, Hirotaka, this was indeed a weird issue that seems fixed now.

Bram, please disregard the OCaml-ftplugin file I've sent earlier. The
one I've attached now should have all patches (including the removal
of the efm-setting).

Btw., the compiler-settings don't load unless I enter ":compiler
ocaml". This may be annoying for beginners who might expect things to
work without having to change their Vim-configuration. What would be
the best way to set this as an overridable default?

Regards,
Markus
ocaml.vim

glts

unread,
Jul 24, 2013, 1:47:59 PM7/24/13
to vim...@googlegroups.com
On Wed, Jul 24, 2013 at 7:10 PM, Markus Mottl <markus...@gmail.com> wrote:
> Btw., the compiler-settings don't load unless I enter ":compiler
> ocaml". This may be annoying for beginners who might expect things to
> work without having to change their Vim-configuration. What would be
> the best way to set this as an overridable default?

This is not normally done. In fact, the Ada ftplugin is the only one in
all of Vim's runtime files that sets a compiler for the user.

Beginners can learn. How about adding a note with a suggested
autocommand inside the plugin?

:autocmd FileType ocaml compiler ocaml

People need to look inside the plugin anyway to find out about the
mappings that you define for them.

Bram Moolenaar

unread,
Jul 25, 2013, 4:03:22 PM7/25/13
to Markus Mottl, Hirotaka Hamada, vim...@vim.org

Markus Mottl wrote:

> Thanks, Hirotaka, this was indeed a weird issue that seems fixed now.
>
> Bram, please disregard the OCaml-ftplugin file I've sent earlier. The
> one I've attached now should have all patches (including the removal
> of the efm-setting).

Thanks, I'll include this soon.

> Btw., the compiler-settings don't load unless I enter ":compiler
> ocaml". This may be annoying for beginners who might expect things to
> work without having to change their Vim-configuration. What would be
> the best way to set this as an overridable default?

If nearly everybody uses the same compiler it would be OK, but if it's
a user preference then not.

--
For a moment, nothing happened.
Then, after a second or so, nothing continued to happen.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

Markus Mottl

unread,
Jul 25, 2013, 4:07:58 PM7/25/13
to Bram Moolenaar, Hirotaka Hamada, vim...@vim.org
On Thu, Jul 25, 2013 at 4:03 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
> Markus Mottl wrote:
>> Btw., the compiler-settings don't load unless I enter ":compiler
>> ocaml". This may be annoying for beginners who might expect things to
>> work without having to change their Vim-configuration. What would be
>> the best way to set this as an overridable default?
>
> If nearly everybody uses the same compiler it would be OK, but if it's
> a user preference then not.

Nearly everybody uses the same compiler. In what standard file should
the ":compiler ocaml" setting go? In the ftplugin file? Or
elsewhere?

Regards,
Markus

Bram Moolenaar

unread,
Jul 26, 2013, 2:28:13 PM7/26/13
to Markus Mottl, Hirotaka Hamada, vim...@vim.org

Markus Mottl wrote:

> On Thu, Jul 25, 2013 at 4:03 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
> > Markus Mottl wrote:
> >> Btw., the compiler-settings don't load unless I enter ":compiler
> >> ocaml". This may be annoying for beginners who might expect things to
> >> work without having to change their Vim-configuration. What would be
> >> the best way to set this as an overridable default?
> >
> > If nearly everybody uses the same compiler it would be OK, but if it's
> > a user preference then not.
>
> Nearly everybody uses the same compiler. In what standard file should
> the ":compiler ocaml" setting go? In the ftplugin file? Or
> elsewhere?

The ftplugin. But do it only when the user did not select a compiler
already for this buffer.

--
"Making it up? Why should I want to make anything up? Life's bad enough
as it is without wanting to invent any more of it."
-- Marvin, the Paranoid Android in Douglas Adams'

Markus Mottl

unread,
Jul 26, 2013, 3:10:53 PM7/26/13
to Bram Moolenaar, Hirotaka Hamada, vim...@vim.org
Thanks, Bram, I've updated and attached the OCaml ftplugin file again
(hopefully for the last time now!).

Regards,
Markus
ocaml.vim
Reply all
Reply to author
Forward
0 new messages