Could not load /.TeXmacs/scratch/texts

Hello, occasionally, when I load a document I get a blank TeXmacs document instead of the intended document, and on the bottom left (where it usually says text roman 10) I get the message Could not load /.TeXmacs/scratch/texts.

To be able to load the document, I found that I either have to:

  • close TeXmacs and try open the document again (which can also result in the same problem), OR
  • keep the blank TeXmacs file open, and then load the intended document in a new window, which seems to work. But the problem is I then have two windows, one of which is blank and I will not use. If I try to now close this blank document window whilst all the other windows are open, TeXmacs crashes and closes all open windows. After this, I get a pop-up telling me that TeXmacs has crashed unexpectedly.

I am assuming this is a bug, but was wondering if there is something I can do to fix this.

Operating System: M1 Mac mini, Big Sur 11.5.1

Did you try to delete your TeXmacs home folder? Sometimes if there is a corrupt file TeXmacs behaves badly and deleting the folder forces TeXmacs to regenerate it.
Before deleting it will be necessary to save your customizations (e.g. your my-init-texmacs.scm file or files for packages that you saved in the progs directory).

I know very little about the mechanisms by which TeXmacs works, so I apologize in advance if this is the only help that I will be able to give.

Thank you for your response. Could I ask where I can find this home folder?

One way to find it is to open the file my-init-texmacs.scm from the menu.
First select the Developer tool entry from the Tools menu, then from the Developer menu do Open my-init-texmacs.scm.
Now “Save as…” will propose you the progs subdirectory of the home folder—hopefully this is enough to allow you to identify it.

@pireddag Thank you for your reply. I tried to do this, but sadly the error persists. It seems that my /.TeXmacs/scratch/texts folder is empty. Should there be something in here?

I do not know how TeXmacs does the opening/saving of scratch files, so I will be able to help just a little (maybe some other forum member will be able to help more). In particular, I do not know why TeXmacs tries opening a scratch file when you request an already saved document.

makes me think that perhaps when using TeXmacs you do it from an account that does not have write privilege onto the .TeXmacs directory. In this directory (I assume you mean /.TeXmacs/texts/scratch, with texts and scratch swapped with respect to your post) TeXmacs saves new files (I think in the last state before you assigned them a name; but I do not know). Is this the case?

Another thing that puzzles me is that you get the “Could not load” message with the specification of a directory name, while a quick look at progs/texmacs/texmacs/tm-files.scm makes me think that you should see a file name.

I think if no-one else answers here (may be several people are on vacation) you could try to post your question on the TeXmacs-users mailing list (Joris van der Hoeven—TeXmacs main developer—reads that and only occasionally the forum).