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

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

[elpa] externals/olivetti cb22f8a 127/134: Merge pull request #25 from N


From: Stefan Monnier
Subject: [elpa] externals/olivetti cb22f8a 127/134: Merge pull request #25 from Nielius/fix-scale-width
Date: Thu, 25 Apr 2019 09:57:44 -0400 (EDT)

branch: externals/olivetti
commit cb22f8ab14b7a7ad3b3650b0e36a1b61d1253950
Merge: 0227265 d40a054
Author: Paul W. Rankin <address@hidden>
Commit: GitHub <address@hidden>

    Merge pull request #25 from Nielius/fix-scale-width
    
    Fixed olivetti-scale-width for integer heights
---
 olivetti.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/olivetti.el b/olivetti.el
index 0998e80..16c177f 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -275,11 +275,15 @@ instead `olivetti-set-mode-line'."
 
 For compatibility with `text-scale-mode', if
 `face-remapping-alist' includes a :height property on the default
-face, scale N by that factor, otherwise scale by 1."
-  (* n (or (plist-get (cadr (assq 'default
-                                  face-remapping-alist))
-                      :height)
-           1)))
+face, scale N by that factor if it is a fraction, by (height/100)
+if it is an integer, and otherwise scale by 1."
+  (let
+      ((height (plist-get (cadr (assq 'default face-remapping-alist)) 
:height)))
+    (cond
+     ((integerp height) (* n (/ height 100.0)))
+     ((floatp height) (* n height))
+     (t n))))
+
 
 (defun olivetti-safe-width (width window)
   "Parse WIDTH to a safe value for `olivetti-body-width' for WINDOW.



reply via email to

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