[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70311: Crash when dnd-indicate-insertion-point is non-nil
From: |
Eli Zaretskii |
Subject: |
bug#70311: Crash when dnd-indicate-insertion-point is non-nil |
Date: |
Sun, 14 Apr 2024 13:17:37 +0300 |
> From: Po Lu <luangruo@yahoo.com>
> Cc: gregsexton@gmail.com, 70311@debbugs.gnu.org
> Date: Sun, 14 Apr 2024 17:24:12 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Po Lu <luangruo@yahoo.com>
> >> Cc: gregsexton@gmail.com, 70311@debbugs.gnu.org
> >> Date: Sat, 13 Apr 2024 20:28:14 +0800
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> > So you think the suggested band-aid is the best we can currently do to
> >> > prevent crashes in those cases?
> >>
> >> Yes, unfortunately.
> >
> > Does the band-aid below look OK to you?
> >
> > diff --git a/lisp/dnd.el b/lisp/dnd.el
> > index 89652d3..de1c58a 100644
> > --- a/lisp/dnd.el
> > +++ b/lisp/dnd.el
> > @@ -149,8 +149,13 @@ dnd-handle-movement
> > (with-selected-window window
> > (scroll-down 1))))))))
> > (when dnd-indicate-insertion-point
> > - (ignore-errors
> > - (goto-char (posn-point posn)))))))
> > + (let ((pos (posn-point posn)))
> > + ;; We avoid errors here, since on some systems this runs
> > + ;; when waiting_for_input is non-zero, and that aborts on
> > + ;; error.
> > + (if (and pos (<= (point-min) pos (point-max)))
> > + (goto-char pos)
> > + pos))))))
>
> Yes, please install. Thanks.
Thanks, installed on the emacs-29 branch, and closing the bug.