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

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

[elpa] externals/olivetti da1ef8e 114/134: Improving olivetti-safe-width


From: Stefan Monnier
Subject: [elpa] externals/olivetti da1ef8e 114/134: Improving olivetti-safe-width
Date: Thu, 25 Apr 2019 09:57:40 -0400 (EDT)

branch: externals/olivetti
commit da1ef8ecc848d3f0df9f3775b75997c3dca8f0e6
Author: Paul Rankin <address@hidden>
Commit: Paul Rankin <address@hidden>

    Improving olivetti-safe-width
    
    - always return value, not set olivetti-body-width
    - make min/max stuff clearer
---
 olivetti.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/olivetti.el b/olivetti.el
index 38163ef..8c62b5e 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -296,11 +296,11 @@ May return a float with many digits of precision."
                 (float (frame-char-width (window-frame window))))
              (% window-width 2)))
     (cond ((integerp width)
-           (max (min width (floor window-width)) min-width))
+           (max min-width (min width (floor window-width))))
           ((floatp width)
-           (max (min width 1.0) (/ min-width window-width)))
+           (max (/ min-width window-width) (min width 1.0)))
           ((user-error "`olivetti-body-width' must be an integer or a float")
-           (floor (window-width))))))
+           (eval (car (get 'olivetti-body-width 'standard-value)))))))
 
 
 ;;; Width Interaction



reply via email to

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