I am working on a contribution for AUCTeX that uses the fact that `TeX-master-file`, and similar functions, are called with an extension to get the output files.
However, I noticed that in functions in `tex.el` like `TeX-pdf-tools-sync-view` and `TeX-evince-sync-view-1` the filename of the output file is constructed from the `file` variable along with `(TeX-output-extension)` instead of calling the filename function (like `TeX-master-file`) with `(TeX-output-extension)` as an argument. Is there a reason for this? Would changing that to calling the appropriate filename function be acceptable in my contribution?
Also, this might be related, I noticed that the variable `file` is used in dynamic scope with two different meanings: sometimes as a function to get the filename, other times as the filename itself (after being overwritten on tex-buf.el:534). I am wondering if there is a reason for having the same variable name for two different functionalities. I think having two dynamically-scoped variables (something like `file` and `file-name` for example) would be more useful and less confusing. This would make it possible to call the correct filename function with the output extension in the functions I mentioned above.
Any input on this is much appreciated.