From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: bitten by lexical-binding Date: Sun, 22 Nov 2015 09:08:14 -0800 (PST) Message-ID: References: <9b834ee9-4f63-42ca-98b4-c0f14986642e@default> <87ziy6az2n.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1448212137 28432 80.91.229.3 (22 Nov 2015 17:08:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 17:08:57 +0000 (UTC) To: Michael Heerdegen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 22 18:08:45 2015 Return-path: Envelope-to: ged-emacs-devel@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 1a0Y7r-0003qE-OZ for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 18:08:32 +0100 Original-Received: from localhost ([::1]:56831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Y7r-0001is-Kc for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 12:08:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Y7n-0001in-OR for emacs-devel@gnu.org; Sun, 22 Nov 2015 12:08:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0Y7i-00020f-Mq for emacs-devel@gnu.org; Sun, 22 Nov 2015 12:08:27 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:21445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Y7i-00020U-HF for emacs-devel@gnu.org; Sun, 22 Nov 2015 12:08:22 -0500 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tAMH8Lum004499 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 22 Nov 2015 17:08:21 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id tAMH8LFk015360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 22 Nov 2015 17:08:21 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tAMH8K9t024055; Sun, 22 Nov 2015 17:08:20 GMT In-Reply-To: <87ziy6az2n.fsf@web.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195039 Archived-At: > > Starting with Emacs 25, `mouse-drag-track' does not accept > > the second arg. But invoking it without that argument meant > > that (my version of) `mouse-drag-region' no longer copied > > the text to the kill ring, when `mouse-drag-copy-region'=3Dt. > > That was the problem. >=20 > Can't reproduce here, built from Nov 21 2015. > I copied your code into a file, one time with lexical binding > enabled, one time without. In emacs -Q, I loaded that file > and set mouse-drag-copy-region -> t. > With both file versions, the region was copied to the kill > ring after dragging with the mouse. Thanks for checking. Testing some more, I found that the problem occurred only for Emacs 24.[45], not for Emacs 25. (Coulda sworn that I had the problem for Emacs 25 also, but I sometimes use 24.5 to avoid crashes I get with Emacs 25, and perhaps that's what was involved here - faulty testing.) I've removed the lex binding declaration and fixed the test for passing two args to mouse-drag-track (which fixes the problem for Emacs 24.[45]). Sorry for the noise, and thanks to all for the feedback. ---- BTW, I neglected to say that the point of the code, which is to let a mouse-1 click in the minibuffer invoke `M-x' and remove *Messages*, if *Messages* is already shown, needs these bindings, which are commented out as suggestions in the file header: ;; ;; Do not use `view-echo-area-messages' for `mouse-1'. ;; ;; Use version of `mouse-drag-region' defined here ;; (when (> emacs-major-version 23) ;; (define-key minibuffer-inactive-mode-map [down-mouse-1] nil) ;; (define-key minibuffer-inactive-mode-map [mouse-1] nil)) This is independent of the normal behavior and copying the selection to the kill ring, which was the question here. I mention this only in case someone is interested in this click-in-echo-area behavior and wants to try it.