Add input-file message
This PR was inspired by https://github.com/DominikPeters/texpresso-vscode/issues/1.
TeXpresso now emits an input-file message when a file is being read:
- sexp:
(input-file 123 "foo.tex") - json:
["input-file", 123, "foo.tex"]
The integer is a unique, monotonous index. When a new line is produced with a lower index, it means that the process backtracked and all files with a higher are no longer monitored. (Though this is very likely to be temporary, if installing watchers is expensive, it is better to batch the changes and update the editor state from time to time).
The paths are printed relative to the root file. They might be non-existent on the file-system (for instance if they exist only in TeXpresso's overlay, that is the case for the intermediate files produced by beamer), so users should not make assumpations and validate the path themselves.
Right now it hooks into SyncTeX to track files:
- only text files are tracked (not graphics)
- the indices printed are the SyncTex input indices; they should be attributed no other meaning than being monotonic and useful to detect backtracking occurrences
- disabling SyncTeX will disable the feature... but why would one disable SyncTeX
I might revisit the idea later, consider this a draft.