sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.62k stars 97 forks source link

Re-scope settings stack to typesetter, document, or frame as appropriate #1327

Open alerque opened 2 years ago

alerque commented 2 years ago

Per this comment and following, the relationship between settings and typesetters is a bit conflated. I think we should refactor it entirely. This issue is just a placeholder, but we have a jumble of:

For starters, I don't think we should have a single global SILE.typesetter, we should be able to have several instances of this easily without using a function shuffle dance every time.

Next I think the things in settings need to be scoped somehow such that the stack could be managed by scope (document.* should be scoped to documentState, most of the settings defined in typesetter.lua should be scoped to the typesetter instance state, etc.

alerque commented 2 years ago

c.f. #1361, #1367, and #1368. All three of these issues have a lot of overlap. Also to a minor extent with #76, #83.