I've identified an issue that affects Emacs packages like eat (terminal)
and visual-fill-column.
The core problem is that functions such as text-scale-increase,
text-scale-decrease, and text-scale-set do not trigger hooks such as
window-configuration-change-hook. Because of that, eat does not
instantly update the window when the text scale is changed and
visual-fill-column does not update the margin until we resize the window.
Currently, I've implemented workarounds for the eat package:
(defun persist-text-scale-adjust-eat (&rest args)
"Adjust the text scale of all eat buffers."
(when (derived-mode-p 'eat-mode)
(run-hooks 'window-configuration-change-hook)))
(advice-add 'text-scale-increase :after #'persist-text-scale-adjust-eat)
(advice-add 'text-scale-decrease :after #'persist-text-scale-adjust-eat)
I've implemented a similar solution for visual-fill-column (see
https://codeberg.org/joostkremers/visual-fill-column/pulls/16 ), but the
visual-fill-column maintainer thinks this is probably not the right
solution to this problem. I tend to agree with him.
While these workarounds work, I believe a more robust solution would be
to have text-scale functions automatically trigger hooks such as
window-configuration-change-hook, or perhaps introduce a dedicated hook
for text scale that other plugins could utilize.
This would provide a more maintainable solution and prevent the need for
individual package-specific workarounds.
--
James Cherti
https://www.jamescherti.com/