purescript-emacs / purescript-mode

Emacs major mode and related tools for Purescript
20 stars 10 forks source link

purescript-indentation.el: improve compiler visibility into local variables #19

Closed Hi-Angel closed 1 month ago

Hi-Angel commented 2 months ago

Turning on lexical-binding fixes a bunch of warnings like:

purescript-indentation.el:399:47: Warning: ‘pi’ is an obsolete variable (as of 23.3); use ‘float-pi’ instead.

these warnings are caused by Emacs not being able to determine that pi is actually a local variable. By making use of lexical binding we make Emacs to be able to see through that.

kritzcreek commented 1 month ago

Think you could figure out why the CI is failing here as well? Happy to merge after that. Thanks!

Hi-Angel commented 1 month ago

Well, it fails because latest upstream Emacs expects "lexical-binding" directive to be in every file, that's a new warning.

I'll look at fixing that, but that said I don't think CI was ever passing here, because even that new error aside, it has other byte-compilation errors such as about docstring being too wide or unescaped characters usage in docstring, etc. Even the pi error I am fixing here has always been present.

kritzcreek commented 1 month ago

Allright, in that case I'm happy to merge. Don't worry about fixing stuff that was already erroring.

Hi-Angel commented 1 month ago

@kritzcreek anyway, I went on and fixed all errors in this PR, please review 😊