From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.devel Subject: Re: mouse-drag-and-drop-region Date: Fri, 15 Dec 2017 08:14:50 +0900 Message-ID: <67BAABFE-B45E-415F-BFDA-BED32D6CB982@misasa.okayama-u.ac.jp> References: <5A265E99.8030908@gmx.at> <20171206.182939.453729203755008958.tak.kunihiro@gmail.com> <5A290951.7000807@gmx.at> <20171208.064540.661845144160459379.tak.kunihiro@gmail.com> <5A2A657D.4010909@gmx.at> <5A2BBC85.9050006@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_B5A79D33-29B7-409A-A0F5-1F1C8B0BAC5E" X-Trace: blaine.gmane.org 1513294607 7295 195.159.176.226 (14 Dec 2017 23:36:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 14 Dec 2017 23:36:47 +0000 (UTC) Cc: rswgnu@gmail.com, Eli Zaretskii , Kunihiro Tak , Alex , emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 15 00:36:38 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 1ePd3N-0001I6-VH for ged-emacs-devel@m.gmane.org; Fri, 15 Dec 2017 00:36:38 +0100 Original-Received: from localhost ([::1]:43436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePd3T-0002E6-5v for ged-emacs-devel@m.gmane.org; Thu, 14 Dec 2017 18:36:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePd3J-0002Dm-Af for emacs-devel@gnu.org; Thu, 14 Dec 2017 18:36:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePd3I-0001JK-4g for emacs-devel@gnu.org; Thu, 14 Dec 2017 18:36:33 -0500 Original-Received: from mxl069v65.mxlogic.net ([208.81.69.65]:14212 helo=s18p02o142.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePd3D-0000zo-7b; Thu, 14 Dec 2017 18:36:28 -0500 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o142.mxlogic.net(mxl_mta-8.5.0-1933) with ESMTP id afa033a5.7f0ffa1fc700.54913.00-575.111715.s18p02o142.mxlogic.net (envelope-from ); Thu, 14 Dec 2017 16:36:26 -0700 (MST) X-MXL-Hash: 5a330afa35624e79-687a0d2e132a10b82ad89f510f5212e85472520e Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o142.mxlogic.net(mxl_mta-8.5.0-1933) over TLS secured channel with ESMTP id b06033a5.0.54682.00-379.111233.s18p02o142.mxlogic.net (envelope-from ); Thu, 14 Dec 2017 16:15:31 -0700 (MST) X-MXL-Hash: 5a330613052f0051-11be6649c0296598d5f2ae13e13b0bd2f7b02572 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 4704_0386_007fd97d_7442_4741_ab5c_ad7bcf9815e2; Fri, 15 Dec 2017 08:15:16 +0900 Original-Received: from [192.168.1.51] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id E324E4C0961; Fri, 15 Dec 2017 08:15:16 +0900 (JST) In-Reply-To: <5A2BBC85.9050006@gmx.at> X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered TRK_NCM1=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6180=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6180> : inlines <6251> : streams <1773132> : uri <2551211> X-AnalysisOut: [v=2.2 cv=PJ5/wbiC c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=ocR9PWop10UA:10 a=mDV] X-AnalysisOut: [3o1hIAAAA:8 a=phNFc8RfAhk5fCGr80IA:9 a=QEXdDO2ut3YA:10 a=l] X-AnalysisOut: [zsgO-w2yvAA:10 a=qaD0urRB-S6HVttqD2YA:9 a=7Zwj6sZBwVKJAoWS] X-AnalysisOut: [PKxL6X1jA+E=:19 a=hquHOILUSkIA:10 a=_FVE-zBwftR9WsbkzFJk:2] X-AnalysisOut: [2] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017121416); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 208.81.69.65 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:221074 Archived-At: --Apple-Mail=_B5A79D33-29B7-409A-A0F5-1F1C8B0BAC5E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I re-re-re-revised mouse-drag-and-drop-region. I'm sending reply to = https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00258.html, = ChangeLog, and patch. * ChangeLog 2017-12-16 Tak Kunihiro Improve comments and have four new options * lisp/mouse.el (mouse-drag-and-drop-region): Have option to = make dragging cut among buffers. Make usage of tooltip option. (mouse-drag-and-drop-region-cut-when-buffers-differ): New = variable. If non-nil, text is cut instead of copied when dragged among = buffers. (mouse-drag-and-drop-region-show-tooltip): New variable. If = non-nil, text is shown by tooltip in a graphic display. (mouse-drag-and-drop-region-show-cursor): New variable. If = non-nil, point is set to where the mouse cursor. (mouse-drag-and-drop-region-face): New variable for face. The = face is used to highlight the original text. * Reply >>> When the user just clicks within the region (no drag), = window-dropped >>> remains nil. On such condition, window-start should not be set. >>> >>> Let's say there are two window top and bottom (T and B) in a frame. >>> Scroll T to the end. Make region in B. Then click the region. I >>> will see T to be scrolled to the beginning. >> >> Then let's rename window-dropped to something like window-exempt >> and set window-exempt to the window either clicked at or where the = drop >> occurs. > >> =E2=80=8BBetter names might be droppped-window or destination-window. >> If this is nil, then no drag-and-drop occurred; otherwise, >> it is the window of the drop, so why call it window-exempt? > > Because the click or drop exempts that window from the point = restoration > mechanism. OK. I changed from `window-dropped' to `window-exempt=E2=80=99. --Apple-Mail=_B5A79D33-29B7-409A-A0F5-1F1C8B0BAC5E Content-Disposition: attachment; filename=mouse.el.diff Content-Type: application/octet-stream; name="mouse.el.diff" Content-Transfer-Encoding: quoted-printable diff=20--git=20a/lisp/mouse.el=20b/lisp/mouse.el=0Aindex=20= 17d1732..bc56448=0A---=20a/lisp/mouse.el=0A+++=20b/lisp/mouse.el=0A@@=20= -2361,6=20+2361,33=20@@=20text=20is=20copied=20instead=20of=20being=20= cut."=0A=20=20=20:version=20"26.1"=0A=20=20=20:group=20'mouse)=0A=20=0A= +(defcustom=20mouse-drag-and-drop-region-cut-when-buffers-differ=20nil=0A= +=20=20"If=20non-nil,=20cut=20text=20also=20when=20source=20and=20= destination=20buffers=20differ.=0A+If=20this=20option=20is=20nil,=20= `mouse-drag-and-drop-region'=20will=20leave=0A+the=20text=20in=20the=20= source=20buffer=20alone=20when=20dropping=20it=20in=20a=0A+different=20= buffer.=20=20If=20this=20is=20non-nil,=20it=20will=20cut=20the=20text=20= just=0A+as=20it=20does=20when=20dropping=20text=20in=20the=20source=20= buffer."=0A+=20=20:type=20'boolean=0A+=20=20:version=20"26.1"=0A+=20=20= :group=20'mouse)=0A+=0A+(defcustom=20= mouse-drag-and-drop-region-show-tooltip=20256=0A+=20=20"If=20non-nil,=20= text=20is=20shown=20by=20a=20tooltip=20in=20a=20graphic=20display.=0A+If=20= this=20option=20is=20an=20integer,=20such=20as=2032=20or=2064,=20a=20= number=20giving=0A+the=20maximum=20length=20of=20the=20string=20shown=20= in=20tooltip."=0A+=20=20:type=20'integer=0A+=20=20:version=20"26.1"=0A+=20= =20:group=20'mouse)=0A+=0A+(defvar=20= mouse-drag-and-drop-region-show-cursor=20t=0A+=20=20"If=20non-nil,=20= move=20point=20with=20mouse=20cursor=20during=20dragging.=0A+In=20= addition,=20highlight=20the=20original=20region=20with=0A= +`mouse-drag-and-drop-region-face'.")=0A+=0A+(defvar=20= mouse-drag-and-drop-region-face=20'region=0A+=20=20"Face=20to=20= highlight=20the=20original=20text=20during=20dragging.=0A+See=20also=20= `mouse-drag-and-drop-region-show-cursor'.")=0A+=0A=20(defun=20= mouse-drag-and-drop-region=20(event)=0A=20=20=20"Move=20text=20in=20the=20= region=20to=20point=20where=20mouse=20is=20dragged=20to.=0A=20The=20= transportation=20of=20text=20is=20also=20referred=20as=20`drag=20and=20= drop'.=0A@@=20-2369,66=20+2396,250=20@@=20modifier=20key=20was=20pressed=20= when=20dropping,=20and=20the=20value=20of=20the=0A=20variable=20= `mouse-drag-and-drop-region'=20is=20that=20modifier,=20the=20text=0A=20= is=20copied=20instead=20of=20being=20cut."=0A=20=20=20(interactive=20= "e")=0A-=20=20(require=20'tooltip)=0A-=20=20(let=20((start=20= (region-beginning))=0A-=20=20=20=20=20=20=20=20(end=20(region-end))=0A-=20= =20=20=20=20=20=20=20(point=20(point))=0A-=20=20=20=20=20=20=20=20= (buffer=20(current-buffer))=0A-=20=20=20=20=20=20=20=20(window=20= (selected-window))=0A-=20=20=20=20=20=20=20=20value-selection)=0A-=20=20=20= =20(track-mouse=0A-=20=20=20=20=20=20;;=20When=20event=20was=20click=20= instead=20of=20drag,=20skip=20loop=0A-=20=20=20=20=20=20(while=20(progn=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20event=20= (read-event))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= (mouse-movement-p=20event)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Handle=20`mouse-autoselect-window'.=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(eq=20(car-safe=20event)=20= 'select-window)))=0A-=20=20=20=20=20=20=20=20(unless=20value-selection=20= ;=20initialization=0A-=20=20=20=20=20=20=20=20=20=20(delete-overlay=20= mouse-secondary-overlay)=0A-=20=20=20=20=20=20=20=20=20=20(setq=20= value-selection=20(buffer-substring=20start=20end))=0A-=20=20=20=20=20=20= =20=20=20=20(move-overlay=20mouse-secondary-overlay=20start=20end))=20;=20= (deactivate-mark)=0A-=20=20=20=20=20=20=20=20(ignore-errors=20= (deactivate-mark)=20;=20care=20existing=20region=20in=20other=20window=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mouse-set-point=20event)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(tooltip-show=20value-selection)))=0A-=20=20=20=20= =20=20(tooltip-hide))=0A-=20=20=20=20;;=20Do=20not=20modify=20buffer=20= under=20mouse=20when=20"event=20was=20click",=0A-=20=20=20=20;;=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"drag=20negligible",=20or=0A-=20=20=20=20= ;;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"drag=20to=20read-only".=0A= -=20=20=20=20(if=20(or=20(equal=20(mouse-posn-property=20(event-end=20= event)=20'face)=20'region)=20;=20"event=20was=20click"=0A-=20=20=20=20=20= =20=20=20=20=20=20=20(member=20'secondary-selection=20;=20"drag=20= negligible"=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mapcar=20(lambda=20(xxx)=20(overlay-get=20xxx=20'face))=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (overlays-at=20(posn-point=20(event-end=20event)))))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20buffer-read-only)=0A-=20=20=20=20=20=20=20=20;;=20Do=20= not=20modify=20buffer=20under=20mouse.=0A-=20=20=20=20=20=20=20=20(cond=0A= -=20=20=20=20=20=20=20=20=20;;=20"drag=20negligible"=20or=20"drag=20to=20= read-only",=20restore=20region.=0A-=20=20=20=20=20=20=20=20=20= (value-selection=0A-=20=20=20=20=20=20=20=20=20=20(select-window=20= window)=20;=20In=20case=20miss=20drag=20to=20other=20window=0A-=20=20=20=20= =20=20=20=20=20=20(goto-char=20point)=0A-=20=20=20=20=20=20=20=20=20=20= (setq=20deactivate-mark=20nil)=0A-=20=20=20=20=20=20=20=20=20=20= (activate-mark))=0A-=20=20=20=20=20=20=20=20=20;;=20"event=20was=20= click"=0A-=20=20=20=20=20=20=20=20=20(t=0A-=20=20=20=20=20=20=20=20=20=20= (deactivate-mark)=0A-=20=20=20=20=20=20=20=20=20=20(mouse-set-point=20= event)))=0A-=20=20=20=20=20=20;;=20Modify=20buffer=20under=20mouse=20by=20= inserting=20text.=0A-=20=20=20=20=20=20(push-mark)=0A-=20=20=20=20=20=20= (insert=20value-selection)=0A-=20=20=20=20=20=20(when=20(not=20(equal=20= (mark)=20(point)))=20;=20on=20success=20insert=0A-=20=20=20=20=20=20=20=20= (setq=20deactivate-mark=20nil)=0A-=20=20=20=20=20=20=20=20= (activate-mark))=20;=20have=20region=20on=20destination=0A-=20=20=20=20=20= =20;;=20Take=20care=20of=20initial=20region=20on=20source.=0A-=20=20=20=20= =20=20(if=20(equal=20(current-buffer)=20buffer)=20;=20when=20same=20= buffer=0A-=20=20=20=20=20=20=20=20=20=20(let=20(deactivate-mark)=20;=20= remove=20text=0A-=20=20=20=20=20=20=20=20=20=20=20=20(unless=20(member=20= mouse-drag-and-drop-region=20(event-modifiers=20event))=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(kill-region=20(overlay-start=20= mouse-secondary-overlay)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(overlay-end=20= mouse-secondary-overlay))))=0A-=20=20=20=20=20=20=20=20(let=20((window1=20= (selected-window)))=20;=20when=20beyond=20buffer=0A-=20=20=20=20=20=20=20= =20=20=20(select-window=20window)=0A-=20=20=20=20=20=20=20=20=20=20= (goto-char=20point)=20;=20restore=20point=20on=20source=20window=0A-=20=20= =20=20=20=20=20=20=20=20(activate-mark)=20;=20restore=20region=0A-=20=20=20= =20=20=20=20=20=20=20(select-window=20window1))))=0A-=20=20=20=20= (delete-overlay=20mouse-secondary-overlay)))=0A+=20=20(let*=20= ((mouse-button=20(event-basic-type=20last-input-event))=0A+=20=20=20=20=20= =20=20=20=20(mouse-drag-and-drop-region-show-tooltip=0A+=20=20=20=20=20=20= =20=20=20=20(when=20(and=20mouse-drag-and-drop-region-show-tooltip=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (display-multi-frame-p)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(require=20'tooltip))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20mouse-drag-and-drop-region-show-tooltip))=0A+=20=20=20=20=20=20=20=20=20= (start=20(region-beginning))=0A+=20=20=20=20=20=20=20=20=20(end=20= (region-end))=0A+=20=20=20=20=20=20=20=20=20(point=20(point))=0A+=20=20=20= =20=20=20=20=20=20(buffer=20(current-buffer))=0A+=20=20=20=20=20=20=20=20= =20(window=20(selected-window))=0A+=20=20=20=20=20=20=20=20=20= (text-from-read-only=20buffer-read-only)=0A+=20=20=20=20=20=20=20=20=20= (mouse-drag-and-drop-overlay=20(make-overlay=20start=20end))=0A+=20=20=20= =20=20=20=20=20=20point-to-paste=0A+=20=20=20=20=20=20=20=20=20= point-to-paste-read-only=0A+=20=20=20=20=20=20=20=20=20window-to-paste=0A= +=20=20=20=20=20=20=20=20=20buffer-to-paste=0A+=20=20=20=20=20=20=20=20=20= cursor-in-text-area=0A+=20=20=20=20=20=20=20=20=20no-modifier-on-drop=0A= +=20=20=20=20=20=20=20=20=20drag-but-negligible=0A+=20=20=20=20=20=20=20=20= =20clicked=0A+=20=20=20=20=20=20=20=20=20value-selection=20=20=20=20;=20= This=20remains=20nil=20when=20event=20was=20"click".=0A+=20=20=20=20=20=20= =20=20=20text-tooltip=0A+=20=20=20=20=20=20=20=20=20states=0A+=20=20=20=20= =20=20=20=20=20window-exempt)=0A+=0A+=20=20=20=20;;=20STATES=20stores=20= for=20each=20window=20on=20this=20frame=20its=20start=20and=20point=0A+=20= =20=20=20;;=20positions=20so=20we=20can=20restore=20them=20on=20all=20= windows=20but=20for=20the=20one=0A+=20=20=20=20;;=20where=20the=20drop=20= occurs.=20=20For=20inter-frame=20drags=20we'll=20have=20to=20do=0A+=20=20= =20=20;;=20this=20for=20all=20windows=20on=20all=20visible=20frames.=20=20= In=20addition=20we=20save=0A+=20=20=20=20;;=20also=20the=20cursor=20type=20= for=20the=20window's=20buffer=20so=20we=20can=20restore=20it=0A+=20=20=20= =20;;=20in=20case=20we=20modified=20it.=0A+=20=20=20=20;;=20= https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00090.html=0A+=20= =20=20=20(walk-window-tree=0A+=20=20=20=20=20(lambda=20(window)=0A+=20=20= =20=20=20=20=20(setq=20states=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (cons=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(list=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20window=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(copy-marker=20(window-start=20window))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(copy-marker=20(window-point=20window))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(with-current-buffer=20= (window-buffer=20window)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20cursor-type))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= states))))=0A+=0A+=20=20=20=20(condition-case=20nil=0A+=20=20=20=20=20=20= =20=20(progn=0A+=20=20=20=20=20=20=20=20=20=20(track-mouse=0A+=20=20=20=20= =20=20=20=20=20=20=20=20;;=20When=20event=20was=20"click"=20instead=20of=20= "drag",=20skip=20loop.=0A+=20=20=20=20=20=20=20=20=20=20=20=20(while=20= (progn=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20= https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00364.html=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= event=20(read-key))=20=20;=20read-event=20or=20read-key=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20(mouse-movement-p=20= event)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Handle=20`mouse-autoselect-window'.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(eq=20(car-safe=20= event)=20'select-window)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20Obtain=20the=20dragged=20text=20in=20region.=20=20When=20the=20loop=20= was=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20skipped,=20= value-selection=20remains=20nil.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(unless=20value-selection=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(setq=20value-selection=20(buffer-substring=20start=20end))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= mouse-drag-and-drop-region-show-tooltip=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(let=20((text-size=20= mouse-drag-and-drop-region-show-tooltip))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(setq=20text-tooltip=20(if=20(and=20= (integerp=20text-size)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(>=20(length=20value-selection)=20text-size))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(substring=20= value-selection=200=20(/=20text-size=202))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"\n...\n"=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(substring=20value-selection=20(-=20(/=20= text-size=202))=20-1))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= value-selection))))=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20Check=20if=20selected=20text=20is=20read-only.=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20= https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00663.html=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20(add-text-properties=20= (region-beginning)=20(region-end)=20'(read-only=20t))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(setq=20text-from-read-only=20(or=20= text-from-read-only=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(get-text-property=20start=20'read-only)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20(equal=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (next-single-char-property-change=20start=20'read-only=20nil=20end)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20end)))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= window-to-paste=20(posn-window=20(event-end=20event)))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(setq=20point-to-paste=20(posn-point=20= (event-end=20event)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= buffer-to-paste=20(let=20(buf)=20;=20Set=20nil=20when=20target=20buffer=20= is=20minibuffer.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (windowp=20window-to-paste)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(setq=20buf=20(window-buffer=20window-to-paste))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(when=20(not=20(minibufferp=20buf))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20buf))))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(setq=20cursor-in-text-area=20(and=20= window-to-paste=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20point-to-paste=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20buffer-to-paste))=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(when=20cursor-in-text-area=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20Check=20if=20point=20under=20mouse=20is=20read-only.=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(save-window-excursion=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(select-window=20= window-to-paste)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20(add-text-properties=20(region-beginning)=20(region-end)=20= '(read-only=20t))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20point-to-paste-read-only=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(or=20buffer-read-only=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (get-text-property=20point-to-paste=20'read-only))))=0A+=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20Check=20if=20"drag=20but=20= negligible".=20=20Operation=20"drag=20but=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20negligible"=20is=20defined=20as=20drag-and-drop=20= the=20text=20to=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= the=20original=20region.=20=20When=20modifier=20is=20pressed,=20the=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20text=20will=20be=20= inserted=20to=20inside=20of=20the=20original=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20region.=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(setq=20drag-but-negligible=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(member=20= mouse-drag-and-drop-region-face=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(mapcar=20(lambda=20= (xxx)=20(overlay-get=20xxx=20'face))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(overlays-at=20point-to-paste)))))=0A+=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Show=20a=20tooltip.=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(if=20mouse-drag-and-drop-region-show-tooltip=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20(and=20= mouse-drag-and-drop-region-show-tooltip=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20=20=20=20=20=20(not=20drag-but-negligible)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20= (not=20point-to-paste-read-only)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20=20=20=20=20=20cursor-in-text-area)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(tooltip-show=20text-tooltip)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(tooltip-hide))=0A+=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20Show=20cursor=20and=20highlight=20= the=20original=20region.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (when=20mouse-drag-and-drop-region-show-cursor=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20Modify=20cursor=20even=20when=20point=20is=20= out=20of=20frame.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20cursor-type=20(cond=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((not=20= cursor-in-text-area)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20nil)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20((or=20point-to-paste-read-only=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20drag-but-negligible)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20'hollow)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(t=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20'bar)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (when=20cursor-in-text-area=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(overlay-put=20mouse-drag-and-drop-overlay=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20'face=20mouse-drag-and-drop-region-face)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(deactivate-mark)=20;=20Maintain=20region=20= in=20other=20window.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(mouse-set-point=20event)))))=0A+=0A+=20=20=20=20=20=20=20=20=20=20;;=20= Hide=20a=20tooltip.=0A+=20=20=20=20=20=20=20=20=20=20(when=20= mouse-drag-and-drop-region-show-tooltip=20(tooltip-hide))=0A+=0A+=20=20=20= =20=20=20=20=20=20=20;;=20Check=20if=20modifier=20was=20pressed=20on=20= drop.=0A+=20=20=20=20=20=20=20=20=20=20(setq=20no-modifier-on-drop=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20(member=20= mouse-drag-and-drop-region=20(event-modifiers=20event))))=0A+=0A+=20=20=20= =20=20=20=20=20=20=20;;=20Check=20if=20event=20was=20"click".=0A+=20=20=20= =20=20=20=20=20=20=20(setq=20clicked=20(not=20value-selection))=0A+=0A+=20= =20=20=20=20=20=20=20=20=20;;=20Restore=20status=20on=20drag=20to=20= outside=20of=20text-area=20or=20non-mouse=20input.=0A+=20=20=20=20=20=20=20= =20=20=20;;=20= https://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00486.html=0A+=20= =20=20=20=20=20=20=20=20=20(when=20(or=20(not=20cursor-in-text-area)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20(equal=20= (event-basic-type=20event)=20mouse-button)))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20(setq=20drag-but-negligible=20t=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20no-modifier-on-drop=20t))=0A+=0A+=20=20=20=20=20=20= =20=20=20=20;;=20Do=20not=20modify=20any=20buffers=20when=20event=20is=20= "click",=0A+=20=20=20=20=20=20=20=20=20=20;;=20"drag=20but=20= negligible",=20or=20"drag=20to=20read-only".=0A+=20=20=20=20=20=20=20=20=20= =20(let*=20((mouse-drag-and-drop-region-cut-when-buffers-differ=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= no-modifier-on-drop=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20mouse-drag-and-drop-region-cut-when-buffers-differ=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= mouse-drag-and-drop-region-cut-when-buffers-differ)))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(wanna-paste-to-same-buffer=20(equal=20= buffer-to-paste=20buffer))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(wanna-cut-on-same-buffer=20(and=20wanna-paste-to-same-buffer=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= no-modifier-on-drop))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(wanna-cut-on-other-buffer=20(and=20(not=20= wanna-paste-to-same-buffer)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20= mouse-drag-and-drop-region-cut-when-buffers-differ))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(cannot-paste=20(or=20= point-to-paste-read-only=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20(or=20= wanna-cut-on-same-buffer=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20wanna-cut-on-other-buffer)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20text-from-read-only))))=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (cond=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Move=20point=20= within=20region.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(clicked=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(deactivate-mark)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(mouse-set-point=20event))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Undo=20operation.=20Set=20back=20the=20= original=20text=20as=20region.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= ((or=20(and=20drag-but-negligible=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20no-modifier-on-drop)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20cannot-paste)=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Inform=20user=20either=20source=20or=20= destination=20buffer=20cannot=20be=20modified.=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(when=20(and=20(not=20drag-but-negligible)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= cannot-paste)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (message=20"Buffer=20is=20read-only"))=0A+=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Select=20source=20window=20back=20and=20restore=20= region.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= (set-window-point=20window=20point)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(select-window=20window)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(goto-char=20point)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20deactivate-mark=20nil)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(activate-mark))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Modify=20buffers.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(t=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20*=20DESTINATION=20BUFFER::=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20Insert=20the=20text=20to=20= destination=20buffer=20under=20mouse.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(select-window=20window-to-paste)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(setq=20window-exempt=20window-to-paste)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(goto-char=20point-to-paste)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(push-mark)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(insert=20value-selection)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20On=20success,=20set=20the=20text=20as=20region=20on=20= destination=20buffer.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (not=20(equal=20(mark)=20(point)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(setq=20deactivate-mark=20nil)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(activate-mark))=0A+=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20*=20SOURCE=20BUFFER::=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20Set=20back=20the=20original=20text=20as=20region=20or=20= delete=20the=20original=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= text,=20on=20source=20buffer.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (if=20wanna-paste-to-same-buffer=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20When=20source=20buffer=20and=20destination=20buffer=20= are=20the=20same,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20remove=20the=20original=20text.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(when=20no-modifier-on-drop=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(let=20(deactivate-mark)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (delete-region=20(overlay-start=20mouse-drag-and-drop-overlay)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(overlay-end=20= mouse-drag-and-drop-overlay))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20When=20source=20buffer=20and=20destination=20buffer=20are=20= different,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20keep=20= (set=20back=20the=20original=20text=20as=20region)=20or=20remove=20the=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20original=20text.=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(select-window=20= window)=20;=20Select=20window=20with=20source=20buffer.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(goto-char=20point)=20;=20Move=20point=20= to=20the=20original=20text=20on=20source=20buffer.=0A+=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(if=20= mouse-drag-and-drop-region-cut-when-buffers-differ=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Remove=20the=20dragged=20= text=20from=20source=20buffer=20like=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20operation=20`cut'.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(delete-region=20(overlay-start=20= mouse-drag-and-drop-overlay)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (overlay-end=20mouse-drag-and-drop-overlay))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20Set=20back=20the=20dragged=20text=20as=20= region=20on=20source=20buffer=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20like=20operation=20`copy'.=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(activate-mark))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(select-window=20window-to-paste))))))=0A+=20=20=20=20= =20=20(error=20nil))=0A+=0A+=20=20=20=20;;=20Clean=20up.=0A+=20=20=20=20= (delete-overlay=20mouse-drag-and-drop-overlay)=0A+=0A+=20=20=20=20;;=20= Restore=20old=20states=20but=20for=20the=20window=20where=20the=20drop=0A= +=20=20=20=20;;=20occurred.=20Restore=20cursor=20types=20for=20all=20= windows.=0A+=20=20=20=20(dolist=20(state=20states)=0A+=20=20=20=20=20=20= (let=20((window=20(car=20state)))=0A+=20=20=20=20=20=20=20=20(when=20= (and=20window-exempt=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(not=20(eq=20window=20window-exempt)))=0A+=20=20=20=20=20=20=20=20=20= =20(set-window-start=20window=20(nth=201=20state)=20'noforce)=0A+=20=20=20= =20=20=20=20=20=20=20(set-marker=20(nth=201=20state)=20nil)=0A+=20=20=20=20= =20=20=20=20=20=20;;=20If=20window=20is=20selected,=20the=20following=20= automatically=20sets=0A+=20=20=20=20=20=20=20=20=20=20;;=20point=20for=20= that=20window's=20buffer.=0A+=20=20=20=20=20=20=20=20=20=20= (set-window-point=20window=20(nth=202=20state))=0A+=20=20=20=20=20=20=20=20= =20=20(set-marker=20(nth=202=20state)=20nil))=0A+=20=20=20=20=20=20=20=20= (with-current-buffer=20(window-buffer=20window)=0A+=20=20=20=20=20=20=20=20= =20=20(setq=20cursor-type=20(nth=203=20state)))))))=0A=20=0C=0A=20=0A=20= ;;;=20Bindings=20for=20mouse=20commands.=0A= --Apple-Mail=_B5A79D33-29B7-409A-A0F5-1F1C8B0BAC5E--