From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70311: Crash when dnd-indicate-insertion-point is non-nil Date: Sat, 13 Apr 2024 19:00:57 +0300 Message-ID: <86ttk5ntfq.fsf@gnu.org> References: <86wmp1pqj3.fsf@gnu.org> <87il0l325a.fsf@yahoo.com> <867ch1pium.fsf@gnu.org> <878r1h30rl.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37877"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70311@debbugs.gnu.org, gregsexton@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 13 18:02:26 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rvfpi-0009dE-CD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Apr 2024 18:02:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvfpM-0000bb-VB; Sat, 13 Apr 2024 12:02:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvfpD-0000U8-1m for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 12:02:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rvfpC-0002fu-OU for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 12:01:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rvfpM-0001IT-VL for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 12:02:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2024 16:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70311 X-GNU-PR-Package: emacs Original-Received: via spool by 70311-submit@debbugs.gnu.org id=B70311.17130240824599 (code B ref 70311); Sat, 13 Apr 2024 16:02:04 +0000 Original-Received: (at 70311) by debbugs.gnu.org; 13 Apr 2024 16:01:22 +0000 Original-Received: from localhost ([127.0.0.1]:33693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvfog-0001C7-07 for submit@debbugs.gnu.org; Sat, 13 Apr 2024 12:01:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvfoc-0001Bc-MS for 70311@debbugs.gnu.org; Sat, 13 Apr 2024 12:01:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvfoL-0002MM-Kt; Sat, 13 Apr 2024 12:01:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=83iU4u0imuV63p70yyvP1tCTP/LsuyEUgaaETW9jVC8=; b=qEh6Q4prt6YG wu9ZvAW8g+/ZXDNScKXDgirJf8wgclata5DoQe+Od+ywkV9W7lvdkVju3OK5r57ClIqwFaNycC1+x yR5xcE55W/rDoV9DhDzYprUL9GKjjDZWQQ9V6A5H37qGN0YayG9/fhdM+ZqA3UGOzX904KM7ychpG N9uGIYyPQ7Si+yQvAL776B2Lnin+JZabNdVxvWPqVMtgnzrtIdLPq55qFXG+RvifG6OzkQhHBzuzH Gmrw5gmJHAkMXLEKMS8saqtjvmfaC5D2OKmt1ZULUQbDzyLn3/94jTLV/RLiLHzOI0/x7VRSecYC+ dRmMITu4g+MrvZbNHBPloA==; In-Reply-To: <878r1h30rl.fsf@yahoo.com> (message from Po Lu on Sat, 13 Apr 2024 20:28:14 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283222 Archived-At: > From: Po Lu > Cc: gregsexton@gmail.com, 70311@debbugs.gnu.org > Date: Sat, 13 Apr 2024 20:28:14 +0800 > > Eli Zaretskii 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)))))) (defun dnd-handle-one-url (window action url) "Handle one dropped url by calling the appropriate handler.