Sample asynchronous make plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Sample asynchronous make plugin

Yegappan Lakshmanan
Hi,

I am attaching a sample asynchronous make plugin which runs
the make command in the background and adds the make output
to a quickfix list. This plugin relies on recent quickfix features
added to Vim.

To run make in the background, use the following command:

   AsyncMake

You can supply arguments to 'make' by passing it to the
above command.

To display the current make command which is running, use

  AsyncMakeShow

To stop the current make command, use

  AsyncMakeStop

- Yegappan

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

asyncmake.vim (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sample asynchronous make plugin

Bram Moolenaar

Yegappan wrote:

> I am attaching a sample asynchronous make plugin which runs
> the make command in the background and adds the make output
> to a quickfix list. This plugin relies on recent quickfix features
> added to Vim.
>
> To run make in the background, use the following command:
>
>    AsyncMake
>
> You can supply arguments to 'make' by passing it to the
> above command.
>
> To display the current make command which is running, use
>
>   AsyncMakeShow
>
> To stop the current make command, use
>
>   AsyncMakeStop

Thanks.

I think you need to use shellescape() on the arguments.

This adds location to a quickfix list.  Now how do I jump around in
these locations?

Would be nice to have the make output also show up in a terminal.
I wonder if that is possible.

--
Time is money.  Especially if you make clocks.

 /// Bram Moolenaar -- [hidden email] -- 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_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Sample asynchronous make plugin

Yegappan Lakshmanan
Hi Bram,

On Sun, Sep 3, 2017 at 6:48 AM, Bram Moolenaar <[hidden email]> wrote:

>
> Yegappan wrote:
>
>> I am attaching a sample asynchronous make plugin which runs
>> the make command in the background and adds the make output
>> to a quickfix list. This plugin relies on recent quickfix features
>> added to Vim.
>>
>> To run make in the background, use the following command:
>>
>>    AsyncMake
>>
>> You can supply arguments to 'make' by passing it to the
>> above command.
>>
>> To display the current make command which is running, use
>>
>>   AsyncMakeShow
>>
>> To stop the current make command, use
>>
>>   AsyncMakeStop
>
> Thanks.
>
> I think you need to use shellescape() on the arguments.
>
If shellescape() is used to escape the make arguments, then passing
make flags like "-w" doesn't work. For example, invoking
":AsyncMake -w -C src" doesn't work. The above command works
without shellescape().

>
> This adds location to a quickfix list.  Now how do I jump around in
> these locations?
>

You can use the regular quickfix commands to jump around the errors.
Am I missing something here?

>
> Would be nice to have the make output also show up in a terminal.
> I wonder if that is possible.
>

The plugin adds the complete make output to the quickfix list.
So you can browse through the make output in the quickfix window.

I am attaching an updated version of the plugin. This version saves
and uses the 'efm' that was set when the command was invoked.

Regards,
Yegappan

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

asyncmake.vim (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sample asynchronous make plugin

Bram Moolenaar

Yegappan wrote:

> >> I am attaching a sample asynchronous make plugin which runs
> >> the make command in the background and adds the make output
> >> to a quickfix list. This plugin relies on recent quickfix features
> >> added to Vim.
> >>
> >> To run make in the background, use the following command:
> >>
> >>    AsyncMake
> >>
> >> You can supply arguments to 'make' by passing it to the
> >> above command.
> >>
> >> To display the current make command which is running, use
> >>
> >>   AsyncMakeShow
> >>
> >> To stop the current make command, use
> >>
> >>   AsyncMakeStop
> >
> > Thanks.
> >
> > I think you need to use shellescape() on the arguments.
> >
>
> If shellescape() is used to escape the make arguments, then passing
> make flags like "-w" doesn't work. For example, invoking
> ":AsyncMake -w -C src" doesn't work. The above command works
> without shellescape().

OK.

> > This adds location to a quickfix list.  Now how do I jump around in
> > these locations?
> >
>
> You can use the regular quickfix commands to jump around the errors.
> Am I missing something here?

Assuming the user goes do something else while the build is running, how
to get to the right quickfix list?  Using ":colder" to find it doesn't
really work.  How to make the quickfix list of the plugin the current
one?  There is an ID, thus it should be possible.

> > Would be nice to have the make output also show up in a terminal.
> > I wonder if that is possible.
>
> The plugin adds the complete make output to the quickfix list.
> So you can browse through the make output in the quickfix window.

Does that update while the build is progressing?

> I am attaching an updated version of the plugin. This version saves
> and uses the 'efm' that was set when the command was invoked.

Thanks.

--
hundred-and-one symptoms of being an internet addict:
73. You give your dog used motherboards instead of bones

 /// Bram Moolenaar -- [hidden email] -- 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_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Sample asynchronous make plugin

Yegappan Lakshmanan
Hi Bram,

On Mon, Sep 4, 2017 at 11:30 AM, Bram Moolenaar <[hidden email]> wrote:

>
> Yegappan wrote:
>
>> >> I am attaching a sample asynchronous make plugin which runs
>> >> the make command in the background and adds the make output
>> >> to a quickfix list. This plugin relies on recent quickfix features
>> >> added to Vim.
>> >>
>> >> To run make in the background, use the following command:
>> >>
>> >>    AsyncMake
>> >>
>> >> You can supply arguments to 'make' by passing it to the
>> >> above command.
>> >>
>> >> To display the current make command which is running, use
>> >>
>> >>   AsyncMakeShow
>> >>
>> >> To stop the current make command, use
>> >>
>> >>   AsyncMakeStop
>> >
>> > Thanks.
>> >
>> > I think you need to use shellescape() on the arguments.
>> >
>>
>> If shellescape() is used to escape the make arguments, then passing
>> make flags like "-w" doesn't work. For example, invoking
>> ":AsyncMake -w -C src" doesn't work. The above command works
>> without shellescape().
>
> OK.
>
>> > This adds location to a quickfix list.  Now how do I jump around in
>> > these locations?
>> >
>>
>> You can use the regular quickfix commands to jump around the errors.
>> Am I missing something here?
>
> Assuming the user goes do something else while the build is running, how
> to get to the right quickfix list?  Using ":colder" to find it doesn't
> really work.  How to make the quickfix list of the plugin the current
> one?  There is an ID, thus it should be possible.
>

The plugin adds the following line to the beginning of the quickfix list:

Make command (<command>) output

and also sets the quickfix title to <make command>. These can be
used to identify the list.

We can also make the quickfix list as the current list once the make
command completes. But this might be surprising to the user if he is
using the quickfix list for browsing some other output.

>
>> > Would be nice to have the make output also show up in a terminal.
>> > I wonder if that is possible.
>>
>> The plugin adds the complete make output to the quickfix list.
>> So you can browse through the make output in the quickfix window.
>
> Does that update while the build is progressing?
>

Yes. The plugin adds the make output (as it is available) to the quickfix
list. The plugin doesn't wait for the make command to complete to add the
output to the quickfix list.

Regards,
Yegappan

>
>> I am attaching an updated version of the plugin. This version saves
>> and uses the 'efm' that was set when the command was invoked.
>
> Thanks.
>

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.