branch: externals/olivetti
commit 9bd41082a593ba90f3e9e34d3ffc29bbb276b674
Author: Paul Rankin <[email protected]>
Commit: Paul Rankin <[email protected]>
Compatibility fixes for Emacs 26
---
olivetti.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/olivetti.el b/olivetti.el
index f6c3082..a2319ff 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -146,7 +146,7 @@ exiting. The reverse is not true."
;;; Set Environment
-(defun olivetti-set-environment ()
+(defun olivetti-set-environment (&optional frame)
"Set text body width to `olivetti-body-width' with relative margins.
Cycle through all windows displaying current buffer and first
@@ -154,7 +154,7 @@ find the `olivetti-safe-width' to which to set
`olivetti-body-width', then find the appropriate margin size
relative to each window. Finally set the window margins, taking
care that the maximum size is 0."
- (dolist (window (get-buffer-window-list nil nil t))
+ (dolist (window (get-buffer-window-list nil nil (or frame t)))
(let* ((n (olivetti-safe-width (if (integerp olivetti-body-width)
(olivetti-scale-width
olivetti-body-width)
olivetti-body-width)
@@ -334,6 +334,7 @@ hidden."
(if olivetti-mode
(progn
(dolist (hook '(window-configuration-change-hook
+ window-size-change-functions
after-setting-font-hook
text-scale-mode-hook))
(add-hook hook 'olivetti-set-environment t t))
@@ -345,6 +346,7 @@ hidden."
(unless olivetti--visual-line-mode (visual-line-mode 1))
(olivetti-set-environment))
(dolist (hook '(window-configuration-change-hook
+ window-size-change-functions
after-setting-font-hook
text-scale-mode-hook))
(remove-hook hook 'olivetti-set-environment t))