branch: elpa/popon commit 5329d1b47a641341dc15a67daad2dd7e2ca6f171 Merge: c7a7e03aaf cf236932e7 Author: Akib Azmain Turja <a...@disroot.org> Commit: Akib Azmain Turja <a...@disroot.org>
Merge pull request 'make popon-x-y-at-pos accept posn' (#12) from scturtle/emacs-popon:master into master Reviewed-on: https://codeberg.org/akib/emacs-popon/pulls/12 --- 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)