jsinglet / latex-preview-pane

Makes LaTeX editing less painful by providing a updatable preview pane
130 stars 24 forks source link

Replace `switch-to-buffer` by `with-current-buffer` #48

Closed pstch closed 6 years ago

pstch commented 6 years ago

This avoids some problems with preserving the the window point in the TeX buffer.

With Spacemacs in develop branch on Emacs 25, the window point of the buffer always ended up in the same location of the document, which made latex-preview-pane completely unusable.

I have been using this change for a few days now, and have not noticed any change, except to that LaTeX buffer's point doesn't change when updating the preview pane.

jsinglet commented 6 years ago

Thanks for the patch!

pstch commented 6 years ago

@jsinglet : I made a mistake and committed a second patch (234a146ffc61227f63224bbc7d0ecf271804c25d, Use NOWARN for find-file-noselect, to ensure that Emacs doesn't ask to reload the PDF.) to the branch you merged.

This second patch should be fairly benign, and ensures that find-file-noselect will not ask to reload the PDF buffer, but it wasn't described in the PR. I'm using LPP with this change for a few days.

I'll be more careful next time ! Thanks a lot for your work, LPP provides me with a very nice LaTeX workflow for my code specifications and university notes.

When I have time, I'll try to look if I can implement some basic pdf-tools support (with maybe SyncTex, if I manage to), and maybe make LPP work with multiple TeX buffers (and multiple PDF buffers/frames). Sadly, I cannot really say at what time I'll be able to do this, as it depends on too much external constraints.