From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: Emacs 26: Code that fixes mouse-drag-and-drop-region to work across frames Date: Wed, 1 Nov 2017 11:24:44 -0400 Message-ID: References: <86d15rjrpe.fsf@misasa.okayama-u.ac.jp> <86tvywotlz.fsf@misasa.okayama-u.ac.jp> <861sli69gj.fsf@misasa.okayama-u.ac.jp> Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c0945ae71879a055ced7a1e" X-Trace: blaine.gmane.org 1509549939 8615 195.159.176.226 (1 Nov 2017 15:25:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Nov 2017 15:25:39 +0000 (UTC) Cc: emacs-devel To: Tak Kunihiro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 01 16:25:32 2017 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 1e9utU-00017X-BH for ged-emacs-devel@m.gmane.org; Wed, 01 Nov 2017 16:25:28 +0100 Original-Received: from localhost ([::1]:56314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9utW-0002To-D2 for ged-emacs-devel@m.gmane.org; Wed, 01 Nov 2017 11:25:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9utL-0002S8-Oi for emacs-devel@gnu.org; Wed, 01 Nov 2017 11:25:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9utH-0004Vs-Oq for emacs-devel@gnu.org; Wed, 01 Nov 2017 11:25:19 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9utH-0004Vf-LE for emacs-devel@gnu.org; Wed, 01 Nov 2017 11:25:15 -0400 Original-Received: from mail-qk0-f176.google.com ([209.85.220.176]:56085) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1e9utH-0002c6-CE for emacs-devel@gnu.org; Wed, 01 Nov 2017 11:25:15 -0400 Original-Received: by mail-qk0-f176.google.com with SMTP id x82so3082748qkb.12 for ; Wed, 01 Nov 2017 08:25:15 -0700 (PDT) X-Gm-Message-State: AJaThX52TJdMl9Xg30PkPOP42ZapVVBZuK9im+o/pmqHN9DGVCbWKok8 sSshtj+W+SFznX0mEdgqsqCsQ+uHMrwoPv93FE0= X-Google-Smtp-Source: ABhQp+T6u5ua3kZxqCd1ubTIcRZO3wkomOKR5fIZwL47PuleNAVGOP3ovB5OfXwU9Pfp+sW1uTkhOoYE5fZ4CYmq4es= X-Received: by 10.55.73.129 with SMTP id w123mr356055qka.156.1509549914816; Wed, 01 Nov 2017 08:25:14 -0700 (PDT) Original-Received: by 10.200.12.74 with HTTP; Wed, 1 Nov 2017 08:24:44 -0700 (PDT) In-Reply-To: <861sli69gj.fsf@misasa.okayama-u.ac.jp> X-Gmail-Original-Message-ID: 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:219847 Archived-At: --94eb2c0945ae71879a055ced7a1e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Oct 31, 2017 at 10:04 PM, Tak Kunihiro wrote: > > I cannot drag text among frames yet. I think I still miss something. > > Can you show recipe that starts from emacs -Q? > > > > =E2=80=8BSee if adding this fixes it: > > > > (setq mouse-position-function > > (lambda (frame-x-dot-y) > > "Under macOS, mouse-position and mouse-pixel-position > sometimes fail to return the selected-frame (returning the prior frame > instead); fix that here." > > (if frame-x-dot-y (setcar frame-x-dot-y > (selected-frame))) > > frame-x-dot-y)) > > ;; https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00804.html > ;; https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00591.html > ;; https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00588.html > > ;; GNU Emacs 27.0.50 (build 2, x86_64-apple-darwin13.4.0, NS > appkit-1265.21 Version 10.9.5 (Build 13F1911)) > ;; of 2017-11-01 > ;; ./Emacs -Q > ;; M-x eval-buffer > > I start to see yellow preview text by tooltip on destination frame. > However, I cannot drop the text yet. I still miss something. > =E2=80=8BMaybe it would be best if someone fixed the XSETFRAME macro in =E2=80=8Bmouse-position so it works properly under the macOS window system = so we could avoid any work arounds on this. -- Bob >From mouse-position: ;; f =3D SELECTED_FRAME (); ;; XSETFRAME (lispy_dummy, f); ;; It seems like the XSETFRAME macro is not properly copying the value of f on initial frame selection under the macOS window system. --94eb2c0945ae71879a055ced7a1e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Oct 31, 2= 017 at 10:04 PM, Tak Kunihiro <homeros.misasa@gmail.com> wrote:
<= span class=3D"gmail-">>=C2=A0 I cannot drag text among frames yet. I thi= nk I still miss something.
>=C2=A0 Can you show recipe that starts from emacs -Q?
>
> =E2=80=8BSee if adding this fixes it:
>
> (setq mouse-position-function
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (= frame-x-dot-y)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q= uot;Under macOS, mouse-position and mouse-pixel-position sometimes fail to = return the selected-frame (returning the prior frame instead); fix that her= e."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(i= f frame-x-dot-y (setcar frame-x-dot-y (selected-frame)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fr= ame-x-dot-y))

;; https://lists.gnu.org/= archive/html/emacs-devel/2017-10/msg00804.html
;; https://lists.gnu.org/archive= /html/emacs-devel/2017-10/msg00591.html
;; https://lists.gnu.org/archive= /html/emacs-devel/2017-10/msg00588.html

;; GNU Emacs 27.0.50 (build 2, x86_64-apple-darwin13.4.0, NS appkit-1265.21= Version 10.9.5 (Build 13F1911))
;;=C2=A0 of 2017-11-01
;; ./Emacs -Q
;; M-x eval-buffer

I start to see yellow preview text by tooltip on destination frame.
However, I cannot drop the text yet.=C2=A0 I still miss something.

=E2=80=8BMaybe it would be best if someone fixed the XSE= TFRAME macro in =E2=80=8Bmouse-position so it works properly under the macO= S window system so we
could avoid any work arounds on this.=C2=A0 -- Bob
=
From mouse-po= sition:
=C2=A0 =C2=A0 ;;=C2=A0 =C2=A0 f =3D = SELECTED_FRAME ();
=C2=A0 =C2=A0 ;;=C2=A0 = =C2=A0 XSETFRAME (lispy_dummy, f);
=C2=A0 = =C2=A0 ;;=C2=A0 It seems like the XSETFRAME macro is not properly copying t= he value of f on initial frame selection under the macOS window system.

--94eb2c0945ae71879a055ced7a1e--