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: Sat, 23 Jul 2016 16:02:13 +0300 Message-ID: <83twfgv76y.fsf@gnu.org> References: <87y44x2s7v.fsf@gmail.com> <83wpkgz83a.fsf@gnu.org> <871t2mw6el.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1469279005 16254 80.91.229.3 (23 Jul 2016 13:03:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 13:03:25 +0000 (UTC) Cc: 24030@debbugs.gnu.org To: Alex , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 23 15:03:14 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 1bQwaH-0003WQ-IB for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 15:03:13 +0200 Original-Received: from localhost ([::1]:52069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQwaG-0008Mt-CE for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 09:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQwaA-0008Mi-6H for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 09:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQwa6-0001a6-0M for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 09:03:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQwa5-0001a2-TC for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 09:03:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQwa5-0003Oe-Mc for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 09:03:01 -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, 23 Jul 2016 13:03:01 +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.146927893713005 (code B ref 24030); Sat, 23 Jul 2016 13:03:01 +0000 Original-Received: (at 24030) by debbugs.gnu.org; 23 Jul 2016 13:02:17 +0000 Original-Received: from localhost ([127.0.0.1]:34281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQwZN-0003Ng-Fw for submit@debbugs.gnu.org; Sat, 23 Jul 2016 09:02:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQwZI-0003NP-M0 for 24030@debbugs.gnu.org; Sat, 23 Jul 2016 09:02:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQwZA-0001Tw-CQ for 24030@debbugs.gnu.org; Sat, 23 Jul 2016 09:02:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQwZA-0001Th-AZ; Sat, 23 Jul 2016 09:02:04 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2736 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQwZ8-00015W-Jn; Sat, 23 Jul 2016 09:02:02 -0400 In-reply-to: <871t2mw6el.fsf@gmail.com> (message from Alex on Fri, 22 Jul 2016 00:09:22 -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:121446 Archived-At: > From: Alex > Cc: 24030@debbugs.gnu.org > Date: Fri, 22 Jul 2016 00:09:22 -0600 > > > 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. > > It appears that it's somewhere within select-window or something it > calls. After posn-set-point calls select-window in 24.5, deactivate-mark > is nil -- but it's t in 25.1. > > #+BEGIN_SRC elisp > (defun test () > (message "before: %s" deactivate-mark) > (select-window (cadr (window-list))) > (message "after: %s" deactivate-mark)) > #+END_SRC > > In the case where the target window contains the new help buffer, > deactivate-mark will be nil in 24.5 and t in 25.1. Thanks. The reason for the above is that in Emacs 25 deactivate-mark was made a variable that becomes buffer-local when set. And inserting text into a buffer, which happens when describe-function inserts the documentation into *Help*, was made to set the this variable in a way that creates a buffer-local binding for it. That is why select-window gives deactivate-mark a non-nil value: select-window makes the window's buffer the current one, which assigns buffer-local values to all of it variables, including deactivate-mark. Then this buffer-local value is being examined by mouse-drag-region. I think the problem is that the command loop fails to reset the buffer-local value of this variable, so we must add something to keyboard.c, where the global value is reset after each command. I'm CC'ing Stefan, who made the above-mentioned changes, in the hope that he will have some ideas for how to fix this regression.