]> git.eshelyaron.com Git - emacs.git/commitdiff
xwidget: Fix xwidget-at misinterpreting non-xwidget text-properties
authorGeorge Huebner <george@feyor.sh>
Sun, 14 Jul 2024 06:46:07 +0000 (01:46 -0500)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Sep 2024 07:51:44 +0000 (09:51 +0200)
'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
(cherry picked from commit d05d8c336c82457dcad3b924b19c3bb57ff0e791)

lisp/xwidget.el

index bf5987d742fba6f9564aabd0b890bc83dbf442bf..c5a84db6d4a20be38ad4e24def945a9c8d86a97f 100644 (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)))