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

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

[nongnu] elpa/popon cf236932e7 1/3: make popon-x-y-at-pos accept posn


From: ELPA Syncer
Subject: [nongnu] elpa/popon cf236932e7 1/3: make popon-x-y-at-pos accept posn
Date: Tue, 27 Jun 2023 16:02:33 -0400 (EDT)

branch: elpa/popon
commit cf236932e7cd0886e7fffc49d15fdbfa23b94b8d
Author: scturtle <scturtle@gmail.com>
Commit: scturtle <scturtle@gmail.com>

    make popon-x-y-at-pos accept posn
---
 popon.el | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/popon.el b/popon.el
index 1b20a23020..61e522be94 100644
--- a/popon.el
+++ b/popon.el
@@ -599,14 +599,15 @@ Return nil if POINT is not in visible text area.
 
 NOTE: This uses `posn-at-point', which is slow.  So try to minimize
 calls to this function."
-  (let ((window-start-x-y
-         (if (>= emacs-major-version 29)
-             (posn-col-row (posn-at-point (window-start)) 'use-window)
-           (posn-col-row (posn-at-point (window-start)))))
-        (point-x-y
-         (if (>= emacs-major-version 29)
-             (posn-col-row (posn-at-point point) 'use-window)
-           (posn-col-row (posn-at-point point)))))
+  (let* ((pos (if (posnp point) point (posn-at-point point)))
+         (window-start-x-y
+          (if (>= emacs-major-version 29)
+              (posn-col-row (posn-at-point (window-start)) 'use-window)
+            (posn-col-row (posn-at-point (window-start)))))
+         (point-x-y
+          (if (>= emacs-major-version 29)
+              (posn-col-row pos 'use-window)
+            (posn-col-row pos))))
     (cons (if (and (or (not truncate-lines) word-wrap)
                    (if truncate-partial-width-windows
                        (>= (window-total-width)



reply via email to

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