From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#38013: [PATCH] Rectangular region selection with mouse Date: Mon, 18 Nov 2019 19:08:24 +0100 Message-ID: <175E5B2E-2256-4FCD-AA8E-9E5BC6DE7907@acm.org> References: <83lft0m3ug.fsf@gnu.org> <3541E0E8-9E33-4FBD-B0D9-DFF77C241F6F@acm.org> <83y2wzlorw.fsf@gnu.org> <83v9s3lo5f.fsf@gnu.org> <75EC4FBC-F636-4D75-BAC4-982D85188794@acm.org> <9b9222ad-ead7-d0a0-0602-780d0680f070@gmx.at> <6bf229f4-c22f-c3c2-5158-5235f908de3c@gmx.at> <8ec84837-172c-1ce5-cab0-b4c96a86274e@gmx.at> <411EAB4E-B666-4263-8514-5F47391268B1@acm.org> <2df02c1f-fea4-f764-eba6-fd67de581755@gmx.at> <3b74a108-28e3-fd01-64a5-7c4302e3d979@gmx.at> <9A9D13F2-1F4F-4DD4-B92F-96FC4D91DFBD@acm.org> <83pni17x5b.fsf@gnu.org> <8B95D2D3-8E00-45BF-B57D-EFD49D79EB6A@acm.org> <83bltk95p7.fsf@gnu.org> <60DD9D65-C3F0-470E-8489-B333E1889D32@acm.org> <83ftio6lsy.fsf@gnu.org> <290E5E66-964B-4E29-B141-166447AD5556@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_D5D2F075-75F5-4AB0-8AE9-9D24667FD587" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="209645"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38013@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 18 19:09:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iWlSb-000sLZ-Lt for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Nov 2019 19:09:14 +0100 Original-Received: from localhost ([::1]:37936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWlSZ-00023v-T3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Nov 2019 13:09:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35644) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWlSR-00021H-Lq for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2019 13:09:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWlSQ-0002S9-Lr for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2019 13:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iWlSQ-0002Rp-Hs for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2019 13:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iWlSQ-00087Y-AO for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2019 13:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Nov 2019 18:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38013 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 38013-submit@debbugs.gnu.org id=B38013.157410051231175 (code B ref 38013); Mon, 18 Nov 2019 18:09:02 +0000 Original-Received: (at 38013) by debbugs.gnu.org; 18 Nov 2019 18:08:32 +0000 Original-Received: from localhost ([127.0.0.1]:46204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWlRw-00086l-2e for submit@debbugs.gnu.org; Mon, 18 Nov 2019 13:08:32 -0500 Original-Received: from mail150c50.megamailservers.eu ([91.136.10.160]:33016 helo=mail50c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWlRt-00086b-6I for 38013@debbugs.gnu.org; Mon, 18 Nov 2019 13:08:30 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1574100507; bh=4DnThEZwYl/Ms1oUFL3ZYRDT7cmEtSw0e5U82oebdEk=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=eXVqte+S5Sp10oLyHz2bNE7x36yfkr8IJIo0CnedlT4ddTjwYLJ+aHrNmDSgnAvCQ b6326Ji4tZD+rEHWroCuqDqc2OcMbfylXwYzxSMmrPgB7EuRrIH5irE//3GQVKlHZM dF1Em0flB7T6uD5N3VeCFufrmc5O626jKQUfVK9Y= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (c-ee54e353.032-75-73746f71.bbcust.telenor.se [83.227.84.238]) (authenticated bits=0) by mail50c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id xAII8PA4017170; Mon, 18 Nov 2019 18:08:26 +0000 In-Reply-To: <290E5E66-964B-4E29-B141-166447AD5556@acm.org> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0212.5DD2DE1B.0014, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=N4FX6F1B c=1 sm=1 tr=0 a=Fmb7hdz85/yTNbhpOvpRKA==:117 a=Fmb7hdz85/yTNbhpOvpRKA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=M51BFTxLslgA:10 a=7KflRGB0heAfHDW4LRkA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=CjuIK1q_8ugA:10 a=hRsXvZWR3pOiuefzIGcA:9 a=B2y7HmGcmWMA:10 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: 209.51.188.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:171925 Archived-At: --Apple-Mail=_D5D2F075-75F5-4AB0-8AE9-9D24667FD587 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here is an updated patch that makes the selection work better with = characters that aren't a multiple of the standard font width.=20 The underlying rect.el isn't really geared for this sort of thing, = leading to ragged rectangle edges and other effects, but at least it is = not a new problem; this is not the time to fix it. --Apple-Mail=_D5D2F075-75F5-4AB0-8AE9-9D24667FD587 Content-Disposition: attachment; filename=0001-Mouse-rectangular-region-selection-bug-38013.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Mouse-rectangular-region-selection-bug-38013.patch" Content-Transfer-Encoding: quoted-printable =46rom=2038cc3baa7f01f418653e36cc5d8e4cf5b151d26e=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Fri,=2025=20Oct=202019=2011:16:39=20+0200=0A= Subject:=20[PATCH]=20Mouse=20rectangular=20region=20selection=20= (bug#38013)=0A=0AMake=20it=20possible=20to=20select=20a=20rectangular=20= region=20using=20the=20mouse.=0AThe=20standard=20binding=20is=20= C-M-mouse-1.=0A=0A*=20lisp/mouse.el=20(mouse-scroll-subr):=20Add=20= ADJUST=20argument.=0A(mouse-drag-region-rectangle):=20New.=0A*=20= lisp/rect.el=20(rectangle--reset-point-crutches):=20New.=0A= (rectangle--reset-crutches):=20Use=20'rectangle--reset-point-crutches'.=0A= *=20src/xdisp.c=20(remember_mouse_glyph,=20syms_of_xdisp):=0AAdd=20= 'fine-grained-mouse-movement'.=0A*=20doc/lispref/commands.texi=20(Motion=20= Events):=0ADocument=20'fine-grained-mouse-movement'.=0A*=20= doc/emacs/frames.texi=20(Mouse=20Commands):=0A*=20doc/emacs/killing.texi=20= (Rectangles):=0A*=20etc/NEWS:=20Document=20rectangular=20selection=20= with=20the=20mouse.=0A---=0A=20doc/emacs/frames.texi=20=20=20=20=20|=20=20= =204=20++=0A=20doc/emacs/killing.texi=20=20=20=20|=20=20=203=20++=0A=20= doc/lispref/commands.texi=20|=20=20=206=20+++=0A=20etc/NEWS=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20|=20=20=203=20++=0A=20= lisp/mouse.el=20=20=20=20=20=20=20=20=20=20=20=20=20|=20109=20= +++++++++++++++++++++++++++++++++++++-=0A=20lisp/rect.el=20=20=20=20=20=20= =20=20=20=20=20=20=20=20|=20=20=208=20++-=0A=20src/xdisp.c=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20|=20=2012=20+++++=0A=207=20files=20= changed,=20142=20insertions(+),=203=20deletions(-)=0A=0Adiff=20--git=20= a/doc/emacs/frames.texi=20b/doc/emacs/frames.texi=0Aindex=20= 091c011fb9..f6c2d23913=20100644=0A---=20a/doc/emacs/frames.texi=0A+++=20= b/doc/emacs/frames.texi=0A@@=20-91,6=20+91,10=20@@=20Mouse=20Commands=0A=20= click=20position;=20otherwise,=20set=20mark=20at=20the=20current=20value=20= of=20point=20and=0A=20point=20at=20the=20click=20position.=20=20Save=20= the=20resulting=20region=20in=20the=20kill=0A=20ring;=20on=20a=20second=20= click,=20kill=20it=20(@code{mouse-save-then-kill}).=0A+=0A+@item=20= C-M-mouse-1=0A+Activate=20a=20rectangular=20region=20around=20the=20text=20= selected=20by=20dragging.=0A+@xref{Rectangles}.=0A=20@end=20table=0A=20=0A= =20@findex=20mouse-set-point=0Adiff=20--git=20a/doc/emacs/killing.texi=20= b/doc/emacs/killing.texi=0Aindex=2080e2868908..ce00cb38a7=20100644=0A---=20= a/doc/emacs/killing.texi=0A+++=20b/doc/emacs/killing.texi=0A@@=20-732,6=20= +732,9=20@@=20Rectangles=0A=20and=20mark=20values=20can=20be=20= interpreted=20either=20as=20a=20region=20or=20as=20a=0A=20rectangle,=20= depending=20on=20the=20command=20that=20uses=20them.=0A=20=0A+=20=20A=20= rectangular=20region=20can=20also=20be=20marked=20using=20the=20mouse:=20= click=20and=20drag=0A+@kbd{C-M-mouse-1}=20from=20one=20corner=20of=20the=20= rectangle=20to=20the=20opposite.=0A+=0A=20@table=20@kbd=0A=20@item=20C-x=20= r=20k=0A=20Kill=20the=20text=20of=20the=20region-rectangle,=20saving=20= its=20contents=20as=20the=0Adiff=20--git=20a/doc/lispref/commands.texi=20= b/doc/lispref/commands.texi=0Aindex=200c848a8025..8a614c721f=20100644=0A= ---=20a/doc/lispref/commands.texi=0A+++=20b/doc/lispref/commands.texi=0A= @@=20-1661,6=20+1661,12=20@@=20Motion=20Events=0A=20does=20not=20= generate=20events=20for=20mere=20motion=20of=20the=20mouse,=20and=20= these=0A=20events=20do=20not=20appear.=20=20@xref{Mouse=20Tracking}.=0A=20= =0A+@defvar=20fine-grained-mouse-movement=0A+When=20non-@code{nil},=20= mouse=20motion=20events=20are=20generated=20even=20for=20very=0A+small=20= movements.=20=20Otherwise,=20motion=20events=20are=20not=20generated=20= as=20long=0A+as=20the=20mouse=20cursor=20remains=20pointing=20to=20the=20= same=20glyph=20in=20the=20text.=0A+@end=20defvar=0A+=0A=20@node=20Focus=20= Events=0A=20@subsection=20Focus=20Events=0A=20@cindex=20focus=20event=0A= diff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20485d2b1fdf..db00d40bb6=20= 100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A@@=20-582,6=20+582,9=20@@=20= region=20using=20a=20given=20replacement-function=20in=20a=20= non-destructive=20manner=0A=20arguments=20mitigating=20performance=20= issues=20when=20operating=20on=20huge=0A=20buffers.=0A=20=0A++++=0A+**=20= Dragging=20'C-M-mouse-1'=20now=20marks=20rectangular=20regions.=0A+=0A=20= +++=0A=20**=20The=20command=20'delete-indentation'=20now=20operates=20on=20= the=20active=20region.=0A=20If=20the=20region=20is=20active,=20the=20= command=20joins=20all=20the=20lines=20in=20the=0Adiff=20--git=20= a/lisp/mouse.el=20b/lisp/mouse.el=0Aindex=20c91760a734..29cb9716c3=20= 100644=0A---=20a/lisp/mouse.el=0A+++=20b/lisp/mouse.el=0A@@=20-1045,10=20= +1045,12=20@@=20mouse-scroll-min-lines=0A=20of=20lines=20specified=20by=20= this=20variable."=0A=20=20=20:type=20'integer)=0A=20=0A-(defun=20= mouse-scroll-subr=20(window=20jump=20&optional=20overlay=20start)=0A= +(defun=20mouse-scroll-subr=20(window=20jump=20&optional=20overlay=20= start=20adjust)=0A=20=20=20"Scroll=20the=20window=20WINDOW,=20JUMP=20= lines=20at=20a=20time,=20until=20new=20input=20arrives.=0A=20If=20= OVERLAY=20is=20an=20overlay,=20let=20it=20stretch=20from=20START=20to=20= the=20far=20edge=20of=0A=20the=20newly=20visible=20text.=0A+ADJUST,=20if=20= non-nil,=20is=20a=20function,=20without=20arguments,=20to=20call=20after=0A= +setting=20point.=0A=20Upon=20exit,=20point=20is=20at=20the=20far=20edge=20= of=20the=20newly=20visible=20text."=0A=20=20=20(cond=0A=20=20=20=20((and=20= (>=20jump=200)=20(<=20jump=20mouse-scroll-min-lines))=0A@@=20-1077,6=20= +1079,8=20@@=20mouse-scroll-subr=0A=20=09=09=20=20=20;;=20so=20that=20we=20= don't=20mess=20up=20the=20selected=20window.=0A=20=09=09=20=20=20(or=20= (eq=20window=20(selected-window))=0A=20=09=09=20=20=20=20=20=20=20= (goto-char=20opoint))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(when=20adjust=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(funcall=20adjust))=0A=20=09=09=20=20=20(sit-for=20= mouse-scroll-delay)))))=0A=20=20=20=20=20(or=20(eq=20window=20= (selected-window))=0A=20=09(goto-char=20opoint))))=0A@@=20-1960,6=20= +1964,109=20@@=20secondary-selection-from-region=0A=20=20=20=20=20= (move-overlay=20mouse-secondary-overlay=20(region-beginning)=20= (region-end))))=0A=20=0A=20=0C=0A+(defun=20mouse-drag-region-rectangle=20= (start-event)=0A+=20=20"Set=20the=20region=20to=20the=20rectangle=20that=20= the=20mouse=20is=20dragged=20over.=0A+This=20must=20be=20bound=20to=20a=20= button-down=20mouse=20event."=0A+=20=20(interactive=20"e")=0A+=20=20= (let*=20((scroll-margin=200)=0A+=20=20=20=20=20=20=20=20=20(start-pos=20= (event-start=20start-event))=0A+=20=20=20=20=20=20=20=20=20(start-posn=20= (event-start=20start-event))=0A+=20=20=20=20=20=20=20=20=20(start-point=20= (posn-point=20start-posn))=0A+=20=20=20=20=20=20=20=20=20(start-window=20= (posn-window=20start-posn))=0A+=20=20=20=20=20=20=20=20=20(start-hscroll=20= (window-hscroll=20start-window))=0A+=20=20=20=20=20=20=20=20=20= (start-col=20(+=20(car=20(posn-col-row=20start-pos))=20start-hscroll))=0A= +=20=20=20=20=20=20=20=20=20(bounds=20(window-edges=20start-window))=0A+=20= =20=20=20=20=20=20=20=20(top=20(nth=201=20bounds))=0A+=20=20=20=20=20=20=20= =20=20(bottom=20(if=20(window-minibuffer-p=20start-window)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(nth=203=20bounds)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(1-=20(nth=203=20= bounds))))=0A+=20=20=20=20=20=20=20=20=20(dragged=20nil)=0A+=20=20=20=20=20= =20=20=20=20(old-track-mouse=20track-mouse)=0A+=20=20=20=20=20=20=20=20=20= (old-fine-grained-mouse-movement=20fine-grained-mouse-movement)=0A+=20=20= =20=20=20=20=20=20=20;;=20For=20right-to-left=20text,=20columns=20are=20= counted=20from=20the=20right=20margin;=0A+=20=20=20=20=20=20=20=20=20;;=20= translate=20from=20mouse=20events,=20which=20always=20count=20from=20the=20= left.=0A+=20=20=20=20=20=20=20=20=20(adjusted-col=20(lambda=20(col)=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= (if=20(eq=20(current-bidi-paragraph-direction)=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= 'right-to-left)=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(frame-text-cols)=20col=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= =20col))))=0A+=20=20=20=20(setq=20track-mouse=20t)=0A+=20=20=20=20(setq=20= fine-grained-mouse-movement=20t)=0A+=20=20=20=20(set-transient-map=0A+=20= =20=20=20=20(let=20((map=20(make-sparse-keymap)))=0A+=20=20=20=20=20=20=20= (define-key=20map=20[switch-frame]=20#'ignore)=0A+=20=20=20=20=20=20=20= (define-key=20map=20[select-window]=20#'ignore)=0A+=20=20=20=20=20=20=20= (define-key=20map=20[mouse-movement]=0A+=20=20=20=20=20=20=20=20=20= (lambda=20(event)=0A+=20=20=20=20=20=20=20=20=20=20=20(interactive=20= "e")=0A+=20=20=20=20=20=20=20=20=20=20=20(unless=20dragged=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20This=20is=20actually=20a=20drag.=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20(mouse-minibuffer-check=20start-event)=0A= +=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(posn-set-point=20start-pos)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20(rectangle-mark-mode)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Only=20tell=20rectangle=20about=20the=20exact=20= column=20if=20we=20are=20possibly=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20beyond=20end-of-line=20or=20in=20a=20tab,=20since=20the=20column=20= we=20got=20from=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20the=20= mouse=20position=20isn't=20necessarily=20accurate=20for=20use=20in=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20specifying=20a=20rectangle=20= (which=20uses=20the=20`move-to-column'=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20measure).=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (or=20(eolp)=20(eq=20(following-char)=20?\t))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(let=20((col=20(funcall=20adjusted-col=20= start-col)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (rectangle--col-pos=20col=20'mark)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(rectangle--col-pos=20col=20'point)))=0A+=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20(setq=20dragged=20t))=0A+=0A+=20=20=20=20=20=20=20= =20=20=20=20(let*=20((posn=20(event-end=20event))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(window=20(posn-window=20posn))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(hscroll=20(if=20= (window-live-p=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=20=20=20=20=20=20=20=20(window-hscroll=20= 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=20=20=20=200))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(mouse-pos=20(mouse-position))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(mouse-col=20(+=20(cadr=20mouse-pos)=20= hscroll))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mouse-row=20(cddr=20mouse-pos))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(set-col=20(lambda=20()=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(if=20(or=20(eolp)=20= (eq=20(following-char)=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= (rectangle--col-pos=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(funcall=20= adjusted-col=20mouse-col)=20'point)=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= (rectangle--reset-point-crutches)))))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20(if=20(and=20(eq=20window=20start-window)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20mouse-row=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(<=3D=20top=20mouse-row=20= (1-=20bottom)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= Drag=20inside=20the=20same=20window.=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(progn=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(posn-set-point=20posn)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(funcall=20set-col))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Drag=20outside=20the=20window:=20scroll.=0A+=20=20=20= =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=20=20=20((null=20mouse-row))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20((<=20mouse-row=20top)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(mouse-scroll-subr=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20start-window=20(-=20mouse-row=20top)=20nil=20= start-point=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= set-col))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((>=3D=20= mouse-row=20bottom)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mouse-scroll-subr=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20start-window=20(1+=20(-=20mouse-row=20bottom))=20nil=20start-point=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20set-col)))))))=0A= +=20=20=20=20=20=20=20map)=0A+=20=20=20=20=20t=0A+=20=20=20=20=20(lambda=20= ()=0A+=20=20=20=20=20=20=20(setq=20track-mouse=20old-track-mouse)=0A+=20=20= =20=20=20=20=20(setq=20fine-grained-mouse-movement=20= old-fine-grained-mouse-movement)=0A+=20=20=20=20=20=20=20(when=20(or=20= (not=20dragged)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (not=20(mark))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (equal=20(rectangle-dimensions=20(mark)=20(point))=20'(0=20.=201)))=0A+=20= =20=20=20=20=20=20=20=20;;=20No=20nontrivial=20region=20selected;=20= deactivate=20rectangle=20mode.=0A+=20=20=20=20=20=20=20=20=20= (deactivate-mark))))))=0A+=0A+;;=20The=20drag=20event=20must=20be=20= bound=20to=20something=20but=20does=20not=20need=20any=20effect,=0A+;;=20= as=20everything=20takes=20place=20in=20`mouse-drag-region-rectangle'.=0A= +;;=20The=20click=20event=20can=20be=20anything;=20`mouse-set-point'=20= is=20just=20a=20convenience.=0A+(global-set-key=20[C-M-down-mouse-1]=20= #'mouse-drag-region-rectangle)=0A+(global-set-key=20[C-M-drag-mouse-1]=20= #'ignore)=0A+(global-set-key=20[C-M-mouse-1]=20=20=20=20=20=20= #'mouse-set-point)=0A+=0A+=0C=0A=20(defcustom=20mouse-buffer-menu-maxlen=20= 20=0A=20=20=20"Number=20of=20buffers=20in=20one=20pane=20(submenu)=20of=20= the=20buffer=20menu.=0A=20If=20we=20have=20lots=20of=20buffers,=20divide=20= them=20into=20groups=20of=0Adiff=20--git=20a/lisp/rect.el=20= b/lisp/rect.el=0Aindex=204d4d6146f2..1109786fc5=20100644=0A---=20= a/lisp/rect.el=0A+++=20b/lisp/rect.el=0A@@=20-133,11=20+133,15=20@@=20= rectangle--point-col=0A=20(defun=20rectangle--crutches=20()=0A=20=20=20= (cons=20rectangle--mark-crutches=0A=20=20=20=20=20=20=20=20=20= (window-parameter=20nil=20'rectangle--point-crutches)))=0A-(defun=20= rectangle--reset-crutches=20()=0A-=20=20(kill-local-variable=20= 'rectangle--mark-crutches)=0A+=0A+(defun=20= rectangle--reset-point-crutches=20()=0A=20=20=20(if=20(window-parameter=20= nil=20'rectangle--point-crutches)=0A=20=20=20=20=20=20=20(setf=20= (window-parameter=20nil=20'rectangle--point-crutches)=20nil)))=0A=20=0A= +(defun=20rectangle--reset-crutches=20()=0A+=20=20(kill-local-variable=20= 'rectangle--mark-crutches)=0A+=20=20(rectangle--reset-point-crutches))=0A= +=0A=20;;;=20Rectangle=20operations.=0A=20=0A=20(defun=20= apply-on-rectangle=20(function=20start=20end=20&rest=20args)=0Adiff=20= --git=20a/src/xdisp.c=20b/src/xdisp.c=0Aindex=20c5676b3e17..384827c94e=20= 100644=0A---=20a/src/xdisp.c=0A+++=20b/src/xdisp.c=0A@@=20-2491,6=20= +2491,12=20@@=20remember_mouse_glyph=20(struct=20frame=20*f,=20int=20gx,=20= int=20gy,=20NativeRectangle=20*rect)=0A=20=20=20enum=20glyph_row_area=20= area;=0A=20=20=20int=20x,=20y,=20width,=20height;=0A=20=0A+=20=20if=20= (fine_grained_mouse_movement)=0A+=20=20=20=20{=0A+=20=20=20=20=20=20= STORE_NATIVE_RECT=20(*rect,=20gx,=20gy,=201,=201);=0A+=20=20=20=20=20=20= return;=0A+=20=20=20=20}=0A+=0A=20=20=20/*=20Try=20to=20determine=20= frame=20pixel=20position=20and=20size=20of=20the=20glyph=20under=0A=20=20= =20=20=20=20frame=20pixel=20coordinates=20X/Y=20on=20frame=20F.=20=20*/=0A= =20=0A@@=20-34943,6=20+34949,12=20@@=20syms_of_xdisp=20(void)=0A=20may=20= be=20more=20familiar=20to=20users.=20=20*/);=0A=20=20=20= display_raw_bytes_as_hex=20=3D=20false;=0A=20=0A+=20=20DEFVAR_BOOL=20= ("fine-grained-mouse-movement",=20fine_grained_mouse_movement,=0A+=20=20=20= =20doc:=20/*=20Non-nil=20for=20pixel-wise=20mouse-movement.=0A+When=20= nil,=20mouse-movement=20events=20will=20not=20be=20generated=20as=20long=20= as=20the=0A+mouse=20stays=20within=20the=20extent=20of=20a=20single=20= glyph=20(except=20for=20images).=20=20*/);=0A+=20=20= fine_grained_mouse_movement=20=3D=20false;=0A+=0A=20}=0A=20=0A=20=0A--=20= =0A2.21.0=20(Apple=20Git-122)=0A=0A= --Apple-Mail=_D5D2F075-75F5-4AB0-8AE9-9D24667FD587--