From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24030: 25.0.95; mouse-drag-region regression Date: Wed, 20 Jul 2016 17:40:09 +0300 Message-ID: <83wpkgz83a.fsf@gnu.org> References: <87y44x2s7v.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1469025689 29986 80.91.229.3 (20 Jul 2016 14:41:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2016 14:41:29 +0000 (UTC) Cc: 24030@debbugs.gnu.org To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 16:41:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bPsgT-0001nE-Of for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 16:41:13 +0200 Original-Received: from localhost ([::1]:34987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPsgT-0001Ni-1S for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Jul 2016 10:41:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPsgM-0001NR-NC for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 10:41:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPsgI-0004fi-Mc for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 10:41:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPsgI-0004fe-Io for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 10:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bPsgI-0001XH-D2 for bug-gnu-emacs@gnu.org; Wed, 20 Jul 2016 10:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jul 2016 14:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24030 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24030-submit@debbugs.gnu.org id=B24030.14690256295856 (code B ref 24030); Wed, 20 Jul 2016 14:41:02 +0000 Original-Received: (at 24030) by debbugs.gnu.org; 20 Jul 2016 14:40:29 +0000 Original-Received: from localhost ([127.0.0.1]:58727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPsff-0001WJ-PT for submit@debbugs.gnu.org; Wed, 20 Jul 2016 10:40:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPsfY-0001W2-Iw for 24030@debbugs.gnu.org; Wed, 20 Jul 2016 10:40:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPsfP-0004N5-HI for 24030@debbugs.gnu.org; Wed, 20 Jul 2016 10:40:11 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPsfP-0004LU-Db; Wed, 20 Jul 2016 10:40:07 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4236 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bPsfN-0006ez-Jq; Wed, 20 Jul 2016 10:40:06 -0400 In-reply-to: <87y44x2s7v.fsf@gmail.com> (message from Alex on Tue, 19 Jul 2016 16:11:48 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121303 Archived-At: > From: Alex > Date: Tue, 19 Jul 2016 16:11:48 -0600 > > If you attempt to create a region by dragging the mouse in a > never-before-focused window, then the region isn't shown until letting > go of the mouse button. More accurately, it's not the window that was never the selected one, it's the buffer that is displayed in it. To see that, after selecting the window, switch back to the other window (showing *scratch* in the recipe), then type the same C-h f command again, and you will see the problem, even though the window was already selected. That's because each C-h f erases and fills up the *Help* buffer again. AFAICT, the root cause is the fact that region-active-p returns nil under the specific circumstances of the recipe. Why it returns nil is less clear; AFAICS it's because mark-active is nil after the first click of the mouse, when redisplay--update-region-highlight is called from the display engine. And mark-active is nil because some code that I was unable to track down sets deactivate-mark to non-nil, so the command loop deactivates the mark. I hope someone else will be able to pick up where I left off, and find the offending code. > This doesn't work in the pretest, but it did in Emacs 24.5. Right. Btw, debugging such core features which are implemented in Lisp that is called from the display engine is a nightmare, because there's no easy way of displaying values of key Lisp variables, for the obvious reasons. My conclusion is that such refactoring brings significant maintenance headaches, which need to be carefully considered as part of similar decisions in the future. If someone knows of handy techniques to make this easier, I'd love to hear about them. Thanks.