From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#59785: 30.0.50; mouse-2 > (wrong-type-argument listp #) Date: Sat, 03 Dec 2022 18:22:22 +0100 Message-ID: <87mt84pfld.fsf@web.de> References: <877cz9sje8.fsf@web.de> <83y1rpeg4q.fsf@gnu.org> <83wn79eftm.fsf@gnu.org> <874jucr95p.fsf@web.de> <87zgc4pubh.fsf@web.de> <83359wegvc.fsf@gnu.org> <87r0xgplti.fsf@web.de> <9C75CDAA-F4CF-45A0-9CA4-C9767E4ECE1D@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12039"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59785@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 03 18:23:14 2022 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 1p1WEL-0002sM-IA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Dec 2022 18:23:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1WED-0008Rp-QI; Sat, 03 Dec 2022 12:23:05 -0500 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 1p1WEB-0008QJ-ED for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 12:23:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1WEA-0007xQ-Ly for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 12:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1WEA-0005N3-5M for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 12:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Dec 2022 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59785 X-GNU-PR-Package: emacs Original-Received: via spool by 59785-submit@debbugs.gnu.org id=B59785.167008815220624 (code B ref 59785); Sat, 03 Dec 2022 17:23:02 +0000 Original-Received: (at 59785) by debbugs.gnu.org; 3 Dec 2022 17:22:32 +0000 Original-Received: from localhost ([127.0.0.1]:52358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1WDf-0005Ma-Ix for submit@debbugs.gnu.org; Sat, 03 Dec 2022 12:22:32 -0500 Original-Received: from mout.web.de ([217.72.192.78]:58025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1WDd-0005MU-Th for 59785@debbugs.gnu.org; Sat, 03 Dec 2022 12:22:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1670088143; bh=nq4OdXAFOayR2d3sjXodEGBKE4suoVbYHMtylZJXRlw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=lg0qeET6vsWbkVyTrAFySUYKatMyxG12e0sUJZHP7iP8T4S+VE98YGcQM1c60TSW/ 8TAiTywuE8hx0Ues3R4LXYzEIVXjh3KYpe6iBUAHL5VVePC9Uosi1GiSgj74kPMXXX +ARkzm3gWhvv3uJYrTM/I2nBBvlMTDhvFzPVHIV0eRqffbBOK0ednSxd6vIABny3kq V/l1nn5nKVf7XCvsKKZjmE1MO71ncOyG+4rF+mj6v61WKJpO89b6TpV0aH7KMH935w rBH07YuXfS6Oj2merHNwljQ+SfgiTwqJz3rYVgvGRwTav92QZ+91/OmLY7/BehxmH0 jRY8w8E4LrsYQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.76.229.140]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MpTxm-1oeL1W3p08-00q253; Sat, 03 Dec 2022 18:22:22 +0100 In-Reply-To: <9C75CDAA-F4CF-45A0-9CA4-C9767E4ECE1D@gnu.org> (Eli Zaretskii's message of "Sat, 03 Dec 2022 17:15:21 +0200") X-Provags-ID: V03:K1:rBnwKmD1eyTRoEel6YjrbS2RQOwOuwQBRBcLYh414Omeher6s8a RE/35SXfHjCAsLx/lclYjpP9nQrnt+C9/qNFaD3GLKlpD2j5JsCdlnQa0EROOvkQAlJlTWG yX06fqI1o9DuUy9XSgEWxGljUJRXvhR3Gl0IhwnD+4SWlk7gdD/HG4klvqa/CT/pt9ch++p aJi0P9CIYlULFRMxZtRSQ== UI-OutboundReport: notjunk:1;M01:P0:gQjbbDashFo=;GxXE7bqLeWiUEkGZuexNbvb5Q+D unK+aFmElBdEBQdH3skFFHmGDV0wt/e/saWSQVJTi1T4FeT/AXElNq2aPjZG8uRLEMy5+NJbv N3eH/71m38JLH7qfVwepuZZk/jhKObStaAyodFQnMKhd2+8T/FW4iUfEiaR2f3ltCaUVhEHqK DLzJYioZ4Tl2r2WAJ/g6BfGILE4Hg3DRtoTZ13kPROJuUfgIFoXu6InopxY3xVRCgrroWVn4w +zFJl4Uy6N+gfey0xvmySKt8QMEDyHvkEAIRzhWTIwYNyWVExS2SFVJtQCPXux652yd0eEvab jgaW2/E3c/R4y+HC5lAhC4QPHeQoOAOyRQc3yylhlUUUQAtt4ZWMhTLBs5uL+nkUwjzh9Dnkn W/lOsUCEmxbEw4EmEt3ZF5BOXqNcqoYNFoJQZon23YXIwEitBJV+BZ0zysOYksS4v9BbcbKgR RL/S/1BG+GzvJs8fy2luL+rdlW6NkXW/EmaQiOcuEe0LCBN8pMSrJJpCP/+e5AU4Cn5+ylCBw xYSCxuVZrgVt3wJcQc+RImWAB0Pd6Ra8HpJdsjiFsk/0XiHPEudONaiX3Jap3GnSGbj6Y7v19 iJY5iXSX+eVYCQKB3oTj3q0O8vR7sNzF9avSmj41nziRDQDQPmcmyp1mmSX3MtufffrGfNp4J qUZAkC+nqFo7DiL3LIAqS7ankAT0OMPEy6ZBie2/STC8jzN+IZ9RhmbPoeeMILJ1SEbgkoAJZ E/G/fOJBWeujLs0dxezzUvXkgOpgisQNPZ2qXKaKdKPro7jajM63bAvKVv/T0CVdjPwjxFZ+ 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:249853 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Do you get the exact same error and the same backtrace? If the > backtrace is different, please post it. I got the org-capture issue suppressed by doing this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=drag.diff *** /tmp/ediffrfOigd 2022-12-03 18:09:46.243866776 +0100 --- /home/micha/software/emacs/lisp/mouse-drag.el 2022-12-03 18:02:14.743207682 +0100 *************** *** 283,316 **** window-last-col (- (window-width) 2)) (track-mouse ;; Set 'track-mouse' to something neither nil nor t (Bug#51794). ! (setq track-mouse 'drag-dragging) ! (while (progn ! (setq event (read--potential-mouse-event) ! end (event-end event) ! row (cdr (posn-col-row end)) ! col (car (posn-col-row end))) ! (or (mouse-movement-p event) ! (eq (car-safe event) 'switch-frame))) ! ;; Scroll if see if we're on the edge. ! ;; FIXME: should handle mouse-in-other window. ! (cond ! ((not (eq start-window (posn-window end))) ! t) ; wait for return to original window ! ((<= row 0) (mouse-drag-repeatedly-safe-scroll -1 0)) ! ((>= row window-last-row) (mouse-drag-repeatedly-safe-scroll 1 0)) ! ((and col-scrolling-p (<= col 1)) (mouse-drag-repeatedly-safe-scroll 0 -1)) ! ((and col-scrolling-p (>= col window-last-col)) (mouse-drag-repeatedly-safe-scroll 0 1)) ! (t ! (setq scroll-delta (- row start-row) ! start-row row) ! (if col-scrolling-p ! (setq scroll-col-delta (- col start-col) ! start-col col)) ! (if (or (/= 0 scroll-delta) ! (/= 0 scroll-col-delta)) ! (progn ! (setq have-scrolled t) ! (mouse-drag-safe-scroll scroll-delta scroll-col-delta))))))) ;; If it was a click and not a drag, prepare to pass the event on. ;; Is there a more correct way to reconstruct the event? (if (and (not have-scrolled) --- 283,319 ---- window-last-col (- (window-width) 2)) (track-mouse ;; Set 'track-mouse' to something neither nil nor t (Bug#51794). ! (setq track-mouse 'drag-dragging) ! (while (progn ! (setq event (read--potential-mouse-event) ! end (event-end event) ! row (and (not (eq (car-safe event) 'switch-frame)) ! (cdr (posn-col-row end))) ! col (and (not (eq (car-safe event) 'switch-frame)) ! (car (posn-col-row end)))) ! (or (mouse-movement-p event) ! (eq (car-safe event) 'switch-frame))) ! ;; Scroll if see if we're on the edge. ! ;; FIXME: should handle mouse-in-other window. ! (cond ! ((eq (car-safe event) 'switch-frame)) ! ((not (eq start-window (posn-window end))) ! t) ; wait for return to original window ! ((<= row 0) (mouse-drag-repeatedly-safe-scroll -1 0)) ! ((>= row window-last-row) (mouse-drag-repeatedly-safe-scroll 1 0)) ! ((and col-scrolling-p (<= col 1)) (mouse-drag-repeatedly-safe-scroll 0 -1)) ! ((and col-scrolling-p (>= col window-last-col)) (mouse-drag-repeatedly-safe-scroll 0 1)) ! (t ! (setq scroll-delta (- row start-row) ! start-row row) ! (if col-scrolling-p ! (setq scroll-col-delta (- col start-col) ! start-col col)) ! (if (or (/= 0 scroll-delta) ! (/= 0 scroll-col-delta)) ! (progn ! (setq have-scrolled t) ! (mouse-drag-safe-scroll scroll-delta scroll-col-delta))))))) ;; If it was a click and not a drag, prepare to pass the event on. ;; Is there a more correct way to reconstruct the event? (if (and (not have-scrolled) --=-=-= Content-Type: text/plain With that the issue is gone. The help related problem seems to be different indeed, and is not fixed by the above, or by your change. I don't get a different backtrace as before. And AFAIU changing `help--binding-undefined-p' is not enough: the call is wrapped around the code that errors. I didn't try it but verified with the tracer that it is not called before the error occurs (i.e., it's never called due to the error), and reading the code also suggests that this is too simple. I don't know the logic of this code so I don't want to propose a patch. It seems we must filter out that event but at some other place. I'm not sure if your change in subr.el had an effect or it was an illusion, maybe the effect differs each time, depending if I move the mouse while clicking or whatever. I don't understand why it should have an effect. Maybe it catched something happening later, dunno. Could retry if you think it's worth it. Ok, so we have now different scenarios and different proposed cures. What concretely would help further? Did you try to reproduce the problem btw? I don't feel like I'm the best choice to work on this, I do know only partially what I am doing. Michael. --=-=-=--