Multiple windows for the same file

Hello everyone. I am writing a paper in TeXmacs that is getting quite large. I often need to scroll back and take a look at another chapter. I have a multimonitor setup; back when I used emacs I often opened multiple emacs buffers to the same file and could use other windows to scroll to other location. This does not seem possible in TeXmacs: If I try to open the same file in another windows TeXmacs does nothing. Is this the intended behavior? Am I missing something?

Thanks!

1 Like

I do not know how it is expected to work, but I can make it work on Windows by invoking TeXmacs twice and opening the same file in both instances. I do not know how to refresh one of the buffers after I make changes in other other one (“update buffer” does nothing).

There are a couple of modes in TeXmacs: one is one file per window, I think this is the current default. In the other you can open multiple files per window and also move among buffers. This was the old emacs-like mode. I think still works but I do not use it. I think can be set up in the preferences.

@pireddag that’s very bad habit. In my understanding one instance do not know of the other, so you might loose data in this way since both could try to write the file without checking if the other made modifications.

You could, in principle, use a TeXmacs server to get a synchronized double view of a document, but this is very experimental, so I would not recommend doing any serious work this way. It may become a viable solution in the future.

Following up on Max’s suggestion, with the settings “Multiple documents share window” I am able to open a synchronized double view of a document by opening the same document in a different window—the “new file” icon allows ot open a new window, while the menu does not. In the new window one can then re-open a document.

You can also get a synchronized view in the “Documents in separate windows” mode, by Go -> Load in a second window. I don’t know whether this is intentional, though, and if yes, how well tested this is. I would personally not yet use it on important documents.

I think this is fine. I remember that Joris use TeXmacs in the “multiple document per window mode” and this has been the default for long time. The new mode was introduced to make TeXmacs behave more similarly than modern GUIs but the basic mechanism is more Emacs-like.

Thanks! This is great: exactly what I was looking for.

1 Like

I am working with this setup now. It seems, though, that the result is a noticeable performance hit (lag in appearance of characters after keystrokes). Is this a known issue? If not, how should I debug it/ how to file a bug report? I am using a windows machine.

Does the slowing down only happen when in “dual view”? I’ve tried it, but I haven’t yet reproduced it.

In general TeXmacs can become a bit slower for large documents (> 100 pages) because of the on-the-fly page breaking. It can help to switch to the “papyrus” mode (by clicking the little page icon in the toolbar or “Document -> Page -> Format”) while editing and switch back to “paper” mode when finalizing the document.

1 Like

Here are some details: My document is currently 20 pages. The slowdown became very bad: characters appearing seconds after keypresses. I restarted TeXmacs and the slowdown was no longer there.

When I do open the second window for the same file the slowdown appears but it is subtle and barely noticeable. I do not think it is problem for now. I’ll ping again if the particularly bad behavior reappears.

On a related note. When debugging I found an interesting GUI issue: once I open in “dual view”, I cannot find a way to close one of the windows without closing the whole document. If I close one of the windows either from the “GO” menu, from the “file->Close window” menu, or by clicking the close button. One window closes but the document in the other one also gets closed and I get another empty document displayed.

This seems a bug. Maybe check that you are in the “multiple buffer mode” and eventually you can file a bug report. I’m not using that mode myself very much, so I do not encounter these issues. But I agree that we should allow multiple views on the same document, especially to be able to reference far parts of the document.

You can get to a synchronized “dual view” in both buffer management modes, only the method of getting it is different.

I tried both setups: multiple document and separate window. In both cases closing the window containing one copy of the document closes that document in all windows.

Filed the bug here: GNU TeXmacs - Bugs: bug #60942, Closing a window with a document… [Savannah]

1 Like