xwidget: Fix xwidget-at misinterpreting non-xwidget text-properties

'xwidget-open' wrongly assumed the the text-property at
min-position is an xwidget, if it exists; the fix is just
returning nil if the text-property isn't an xwidget.
* lisp/xwidget.el (xwidget-at): Use 'ignore-errors'.  (Bug#72848)

Copyright-paperwork-exempt: yes
This commit is contained in:
George Huebner 2024-07-14 01:46:07 -05:00 committed by Eli Zaretskii
parent 13f69f254c
commit d05d8c336c

View file

@ -81,7 +81,7 @@ This returns the result of `make-xwidget'."
(defun xwidget-at (pos)
"Return xwidget at POS."
(let* ((disp (get-text-property pos 'display))
(xw (car (cdr (cdr disp)))))
(xw (ignore-errors (car (cdr (cdr disp))))))
(when (xwidget-live-p xw) xw)))