-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing latexmk -pvc
by BufWritePost
autocommand?
#106
Comments
Hi, First, I totally agree that the If I am not mistaken, you were the one to submit the pull request that merged the vimserver approach with the no-vimserver approach. The reason we need both, is that the vimserver approach is superior because it gives asynchronisity, which most people want. However, it is not available on windows, and so we need the no-vimserver approach to be portable. If we change the system such that it depends on an external plugin, this will in itself add some complexity. However, I do believe this might be the way to go in order to improve the code and make it both more flexible, minimalistic, and portable. I have previously looked at vimproc, however, I think vim-dispatch may look more promising. In conclusion, I will support a proposal that simplifies the current system, even if it uses an external plugin. However, I do not agree that we should remove support of the |
Looks like syntastic went through much the same thought process. The result of the discussion seemed to be to stick with synchronous evaluation, because
My additional comments:
|
For what it's worth, I'd summarize the discussion at syntastic in slightly different terms:
Finally, I gave up on all this not for technical reasons, but because I don't care enough about it to spend my time finding ways to overcome Vim's clunkiness. The project's owner (who seems to be on an extended vacation for now) may or may not share my views. So please, do drop us a note if you can find a reasonable solution. :) |
So, what are your conclusions, @LeszekSwirski? You suggest not to rely on the vimserver, and thus to remove the vimserver support? Personally, I have become very fond of the
In the current version of LatexBox, we already depend heavily on latexmk. Is there a reason NOT to use the One obvious reason to prefer not to use
If I notice a I would also consider the suggestion by @michamos to not support the A final question: In which cases is the vimserver not available? If I remember correctly, the contribution of @michamos that introduced the async option was introduced in order to increase portability. That is, I remember reading that the vimserver was not available on windows systems, and so we needed the async option. However, with the contribution of @LeszekSwirski, the vimserver approach should now work also on windows: Is it an option to remove the async option and to go back 100% to the vimserver approach? |
@lcd047 Just a couple of corrections/clarifications
@lervag I don't suggest removing vimserver at all, I think it's great. Personally, I would first suggest merging the codepaths for async and continuous preview, and only have the callback depend on vimserver (otherwise, the user has to manually I also consider getting rid of After that, my personally preferred path would be to contribute process killing to vim-dispatch (and possibly live without process killing for now), and then switch to using that, because there's a lot of code duplication between the current LaTeX-Box code and Vim-Dispatch. |
Oh, and if people still want to use |
Sorry for disappearing after opening this issue, I was pretty busy the last couple of days. First I would like to rectify one of @lervag's comments, who gave me undue credit for @mtth's work on the async option. All I did was complain about the changed escaping of options :) Back to this issue, I think there are really two different use cases:
I think it is pretty reasonable for LaTeX-Box to support both modes. For 1. vim-dispatch looks like an excellent fit, with the foreground build For 2., the current approach is with |
Hi, First: My apologies to @mtth for giving his due credit to the wrong person! @michamos You write: "For 1. vim-dispatch looks like an excellent fit, with the foreground build :Make command. This provides asynchronicity and does not steal focus." However, as far as I understand It seems that both @michamos and @LeszekSwirski think that it is a good idea to remove support of |
On second (third? fourth?) look, it looks like I entirely agree than we need asynchronous compilation, and can't go with vim-dispatch without it. The only reason I keep arguing in vim-dispatch's favour is because it's so close to being what we want it to be! |
I've submitted a PR to vim-dispatch, let's see what happens. |
I'm just curious: How exactly would one use a custom callback function with your PR? |
Something along the lines of:
|
Ah, I see! I was thinking in terms of |
Yeah, I didn't want to change the behaviour of |
Hi everyone,
I have been using LaTeX-Box for some time now, and I find the approach of being lightweight and not implementing things that are already taken care of by other plugins (e.g. snippets) very appealing.
However, there is one aspect of LaTeX-Box that departs IMHO from this minimalistic philosophy, namely the handling of
latexmk
.As far as I understand, this complexity is required in order to support the
-pvc
mode, aslatexmk
then runs continuously in the background to watch for changes to the document, and it is necessary to watch the process to load errors in the quickfix window and kill it when appropriate.Although the auto-preview functionality of
-pvc
is extremely convenient, I think that it is possible to offer the same functionality in a much simpler way. Indeed, Vim knows when a buffer is saved, and it is possible to calllatexmk
automatically when that happens instead of having it run continuously. This also allows us to use the standard Vim compiler infrastructure and optionally Tim Pope’s vim-dispatch plugin for asynchronicity.In practice, I suggest the following:
latexmk
command with optional parameters, etc. (but not-pvc
). Use it to setmakeprg
and put it as well as theerrorformat
in a compiler plugin.LatexBox_latexmk()
by a call to:make
or:Make[!]
(provided by vim-dispatch) according to the value ofg:LatexBox_latexmk_async
(and use :Copen in the async case for errors).g:LatexBox_latexmk_preview_continuously
is set, register aBufWritePost
autocommand to callLatexBox_latexmk()
, and either use the-pv
option forlatexmk
or let the previewer handle the reloading itself when it notices that the output file has changed (at least Skim and Evince can do this).What do you think of this proposal?
The text was updated successfully, but these errors were encountered: