From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 d4e1549: Guard terminal parameter in XTerm mouse mode Date: Wed, 23 Nov 2016 17:54:23 +0200 Message-ID: <83bmx66vkg.fsf@gnu.org> References: <20161122204222.29398.86534@vcs.savannah.gnu.org> <20161122204222.DBE712201C5@vcs.savannah.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1479916492 21613 195.159.176.226 (23 Nov 2016 15:54:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2016 15:54:52 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 23 16:54:48 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9Zsl-0004wR-NB for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2016 16:54:47 +0100 Original-Received: from localhost ([::1]:34650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9Zsp-00078N-BG for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2016 10:54:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9Zsg-00077B-Pl for emacs-devel@gnu.org; Wed, 23 Nov 2016 10:54:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9Zsc-0007Ev-Uo for emacs-devel@gnu.org; Wed, 23 Nov 2016 10:54:42 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9Zsc-0007En-Rc; Wed, 23 Nov 2016 10:54:38 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2478 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c9Zsc-0004TJ-2E; Wed, 23 Nov 2016 10:54:38 -0500 In-reply-to: (message from Philipp Stephani on Wed, 23 Nov 2016 12:20:16 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209566 Archived-At: > From: Philipp Stephani > Date: Wed, 23 Nov 2016 12:20:16 +0000 > > Stefan Monnier schrieb am Mi., 23. Nov. 2016 um 02:08 Uhr: > > > + (setf (terminal-parameter nil 'xterm-mouse-last-down) > > + ;; EVENT might be handed back to the input queue, which > > + ;; might modify it. Copy it into the terminal parameter > > + ;; to guard against that. > > + (copy-sequence event)) > > Do you have further information about when/where events might be > modified in place? It sounds like a risky operation. > > I assume it's in the code that translates consecutive mouse-down events to mouse-movement events. It's > easy to reproduce in HTerm: without the patch, dragging the mouse while holding a button causes > "drag-mouse-0" events to be generated. These come from spurious mouse-movement events in > xterm-mouse-last-down. Since nothing places these events explicitly there, the root cause must be that the > event list is overwritten. > Agreed that the input loop probably shouldn't modify event objects. But it might be a necessary optimization > somewhere. Unfortunately I wasn't able to find the specific piece of code responsible for this modification. Does this have to be applied to the release branch? If so, can you tell why?