Hi Tassilo, Tassilo Horn <t...@gnu.org> writes:
> Arash Esbati <ar...@gnu.org> writes: > > the defvars look good to me. Thanks for checking. > Why is that needed? As far as I see, that function only complains about > variables defined by AUCTeX itself which you can also defvar, no? Yes, the complaints about free variables `TeX-*' vanish by defvar'ing them. > In TeX-pdf-tools-sync-view: > tex.el:1187:11: Warning: reference to free variable ‘TeX-PDF-mode’ > tex.el:1191:12: Warning: reference to free variable > ‘TeX-source-correlate-mode’ > tex.el:1193:38: Warning: reference to free variable > ‘TeX-current-process-region-p’ > tex.el:1197:24: Warning: reference to free variable ‘file’ > > Of course with the exception of the variable `file' set via dynamic > scoping which is one hindrance for switching to lexical-binding and as > such should produce a compiler warning. Yep, `file' is the only warning which remains, defvar'ing doesn't help here (lack of prefix warning) > Maybe we should add a > > (defvar TeX-file nil) > > and bind that in addition to the undeclared `file', make AUCTeX itself > only use TeX-file (and update the docs), and eventually omit binding > `file' in the mid-term future. That would be fine with me, I can commit the defvar's only and omit the `with-no-warnings' if you would cater for the rest :-) > Same here. > > In TeX-evince-sync-view-1: > tex.el:1221:43: Warning: reference to free variable ‘file’ > tex.el:1230:40: Warning: reference to free variable > ‘TeX-current-process-region-p’ > > Ah, or is it complaining about the dbus functions? I guess they are > only available on GNU/Linux (and you didn't turn off dbus support). My understanding here was `file' again and not dbus. > But anyway, I would like to keep warnings about abusing dynamic scope > such as the warning about `file' here. I'd really like to see AUCTeX building clean. Can we make a compromise? If you can get rid of `file' complaints by changing the code, that would be great. Otherwise, we use `with-no-warnings' and add I'll add some comments to tex.el (and latex.el and context.el) for functions where it should be removed first once we move towards lexical-binding. WDYT? Best, Arash