Support polymode
It'd be nice if olivetti and polymode support each other. I believe it makes more sense to implement the support on polymode, but it looks like the project hasn't been updated for a year.
Alternatively, if https://github.com/polymode/polymode/pull/340 doesn't get merged, olivetti could include
(when (fboundp 'polymode-minor-mode)
(add-to-list 'polymode-move-these-minor-modes-from-old-buffer 'olivetti-mode)
(add-to-list 'polymode-move-these-vars-from-old-buffer 'olivetti-body-width))
and suggest loading after polymode (?)
Mostly wanted to crossref 😊
I think you're right that it makes more sense to implement in polymode, given they already support writeroom-mode. I've subscribed to that PR and will keep an eye on it.
I think these should be better done on every mode basis. It's not sustainable to keep adding altering modes inside polymode proper. Each mode's author knows best which variables are relevant and could modify the setup if those change without altering polymode code.
and suggest loading after polymode (?)
This is not needed. One could
(with-eval-after-load 'polymode
(add-to-list 'polymode-move-these-minor-modes-from-old-buffer 'olivetti-mode)
(add-to-list 'polymode-move-these-vars-from-old-buffer 'olivetti-body-width))