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

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

[elpa] externals/posframe 3effe69 3/3: * posframe.el (posframe-show): cl


From: ELPA Syncer
Subject: [elpa] externals/posframe 3effe69 3/3: * posframe.el (posframe-show): clean code about max/min of width/height.
Date: Wed, 3 Nov 2021 01:57:38 -0400 (EDT)

branch: externals/posframe
commit 3effe69038de5e21c47b658e4dd11d3baf3e208d
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    * posframe.el (posframe-show): clean code about max/min of width/height.
---
 posframe.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/posframe.el b/posframe.el
index f639cb2..1736eb2 100644
--- a/posframe.el
+++ b/posframe.el
@@ -539,20 +539,18 @@ An example parent frame poshandler function is:
 
 You can use `posframe-delete-all' to delete all posframes."
   (let* ((position (or position (point)))
-         (min-width (or min-width 1))
-         (min-height (or min-height 1))
+         (max-width (if (numberp max-width)
+                        (min max-width (frame-width))
+                      (frame-width)))
+         (max-height (if (numberp max-height)
+                         (min max-height (frame-height))
+                       (frame-height)))
+         (min-width (min (or min-width 1) max-width))
+         (min-height (min (or min-height 1) max-height))
          (width (when width
-                  (min (max min-width
-                            (if (numberp max-width)
-                                (min width max-width)
-                              width))
-                       (frame-width))))
+                  (min (max width min-width) max-width)))
          (height (when height
-                   (min (max min-height
-                             (if (numberp max-height)
-                                 (min height max-height)
-                               height))
-                        (frame-height))))
+                   (min (max height min-height) max-height)))
          (x-pixel-offset (or x-pixel-offset 0))
          (y-pixel-offset (or y-pixel-offset 0))
          ;;-----------------------------------------------------



reply via email to

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