emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/olivetti 2304ddc 124/134: Refactoring style: if -> when


From: Stefan Monnier
Subject: [elpa] externals/olivetti 2304ddc 124/134: Refactoring style: if -> when for condition cases without else
Date: Thu, 25 Apr 2019 09:57:43 -0400 (EDT)

branch: externals/olivetti
commit 2304ddc458d745281d54cbf6db5cf018a1df3ca8
Author: Paul W. Rankin <address@hidden>
Commit: Paul W. Rankin <address@hidden>

    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)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]