branch: externals/olivetti commit 2304ddc458d745281d54cbf6db5cf018a1df3ca8 Author: Paul W. Rankin <he...@paulwrankin.com> Commit: Paul W. Rankin <he...@paulwrankin.com>
Refactoring style: if -> when for condition cases without else --- olivetti.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/olivetti.el b/olivetti.el index 36899ca..5dbe87d 100644 --- a/olivetti.el +++ b/olivetti.el @@ -200,7 +200,7 @@ care that the maximum size is 0." right-margin (max (round (- margin-total right-fringe)) 0)) (set-window-parameter window 'split-window 'olivetti-split-window) (set-window-margins window left-margin right-margin)) - (if olivetti-hide-mode-line (olivetti-set-mode-line)))) + (when olivetti-hide-mode-line (olivetti-set-mode-line)))) (defun olivetti-reset-all-windows () "Remove Olivetti's parameters and margins from all windows. @@ -212,8 +212,8 @@ Cycle through all windows displaying current buffer and call (defun olivetti-reset-window (window) "Remove Olivetti's parameters and margins from WINDOW." - (if (eq (window-parameter window 'split-window) 'olivetti-split-window) - (set-window-parameter window 'split-window nil)) + (when (eq (window-parameter window 'split-window) 'olivetti-split-window) + (set-window-parameter window 'split-window nil)) (set-window-margins window nil)) (defun olivetti-split-window (&optional window size side pixelwise) @@ -390,9 +390,9 @@ hidden." (remove-hook hook 'olivetti-set-environment t)) (olivetti-reset-all-windows) (olivetti-set-mode-line 'exit) - (if (and olivetti-recall-visual-line-mode-entry-state - (not olivetti--visual-line-mode)) - (visual-line-mode 0)) + (when (and olivetti-recall-visual-line-mode-entry-state + (not olivetti--visual-line-mode)) + (visual-line-mode 0)) (kill-local-variable 'split-window-preferred-function) (kill-local-variable 'olivetti--visual-line-mode)))