unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 17378@debbugs.gnu.org, Ishmael <noone.junkmail@gmail.com>
Subject: bug#17378: 24.3.1: xterm-mouse-event: Wrong type argument: wholenump, -6
Date: Sun, 20 Sep 2020 23:34:15 +0200	[thread overview]
Message-ID: <87363cjfoo.fsf@gnus.org> (raw)
In-Reply-To: <jwvbnv9f5s6.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Wed, 07 May 2014 21:15:43 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 5
>> ESC [ M 2 ESC [
>> ESC [ M 2 ESC [
>> ESC [ M 2 ESC [
>> ESC [ M 2 ESC [
>> ESC [ M 2 ESC [
>> ESC [ M 2 ESC [
>
> And here, again the "ESC [ M ?? ESC [" form for the mouse-5.
> I don't think there's much hope to support this mouse-5 click format.
> Looks like a bug somewhere in the terminal (or something stacked in
> between, like screen/pmux).

This was the final message in the thread six years ago, so I wonder
whether it's likely whether we'll make further progress here.  Instead
we can make xterm-mouse-event more defensive here and check whether the
click event is valid (like in the patch below).

Looking at the backtrace, I think this should fix the reported bug, so
I've installed it in Emacs 28.

diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 2b9fab556e..362d29b943 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -237,7 +237,10 @@ xterm-mouse-event
 		      (xterm-mouse--read-event-sequence extension))
 		     (t
 		      (error "Unsupported XTerm mouse protocol")))))
-    (when click
+    (when (and click
+               ;; In very obscure circumstances, the click may become
+               ;; invalid (see bug#17378).
+               (>= (nth 1 click) 0))
       (let* ((type (nth 0 click))
              (x    (nth 1 click))
              (y    (nth 2 click))


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2020-09-20 21:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 22:01 bug#17378: 24.3.1: xterm-mouse-event: Wrong type argument: wholenump, -6 Ishmael
2014-05-01 16:01 ` Stefan Monnier
2014-05-01 16:35   ` Josh
2014-05-01 17:03     ` Stefan Monnier
2014-05-01 17:05       ` Josh
2014-05-01 18:02         ` Stefan Monnier
2014-05-01 18:38           ` Ishmael
2014-05-03  1:45 ` Glenn Morris
2014-05-03 22:40   ` Ishmael
2014-05-04  4:17     ` Stefan Monnier
2014-05-04 18:08     ` Eli Zaretskii
2014-05-04 18:35       ` Ishmael
2014-05-05  1:43         ` Stefan Monnier
2014-05-05 15:52           ` Ishmael
2014-05-05 18:20             ` Stefan Monnier
2014-05-05 18:43               ` Eli Zaretskii
2014-05-05 23:18               ` Stefan Monnier
2014-05-06  3:07                 ` Ishmael
2014-05-06 19:10                   ` Stefan Monnier
2014-05-07  2:00                     ` Ishmael
2014-05-07 13:43                       ` Stefan Monnier
2014-05-07 18:39                         ` Ishmael
2014-05-08  1:15                           ` Stefan Monnier
2020-09-20 21:34                             ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87363cjfoo.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=17378@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=noone.junkmail@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).