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: Thu, 7 Nov 2019 18:48:21 +0100 Message-ID: <411EAB4E-B666-4263-8514-5F47391268B1@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> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_076F2AB6-3450-47BA-BE6E-541D2CBFC637" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="48693"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38013@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 07 18:49:12 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 1iSluB-000CXR-Hl for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Nov 2019 18:49:11 +0100 Original-Received: from localhost ([::1]:46598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSluA-0004Rq-7n for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Nov 2019 12:49:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55065) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSlu3-0004Rh-La for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 12:49:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSlu2-0007ts-GJ for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 12:49:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35051) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSlu2-0007tk-CQ for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 12:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iSlu2-0004A6-73 for bug-gnu-emacs@gnu.org; Thu, 07 Nov 2019 12:49: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: Thu, 07 Nov 2019 17:49: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.157314891215951 (code B ref 38013); Thu, 07 Nov 2019 17:49:02 +0000 Original-Received: (at 38013) by debbugs.gnu.org; 7 Nov 2019 17:48:32 +0000 Original-Received: from localhost ([127.0.0.1]:43872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSltY-00049D-4B for submit@debbugs.gnu.org; Thu, 07 Nov 2019 12:48:32 -0500 Original-Received: from mail237c50.megamailservers.eu ([91.136.10.247]:56084 helo=mail56c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSltV-000492-NS for 38013@debbugs.gnu.org; Thu, 07 Nov 2019 12:48:30 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1573148906; bh=sCNHJpQtOOpQK5O4XzcD1AGbL6xvGPvyVmngcAyW+H4=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=NEkiFzmlBttrZaC5r6nWjElXuNpCBeIXsvZ1zgJGuScrQa9LS1g9yp7j0yNcZFZq2 J/FA5V9vixyfk8GqaZ+LbT1nUH9U7q5whNhERCDMFxNQHehDghzEs46196i/cUNqXd eH/CehbBoLM/IvZUKFPIBfEcwI/bQZj73/tSgT8c= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (c-4c48e655.032-75-73746f71.bbcust.telenor.se [85.230.72.76]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id xA7HmOPa021916; Thu, 7 Nov 2019 17:48:25 +0000 In-Reply-To: <8ec84837-172c-1ce5-cab0-b4c96a86274e@gmx.at> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020B.5DC458EA.004B, 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=Hc1qsRM8 c=1 sm=1 tr=0 a=1rTi8g4bvmsLpnurc7XrhA==:117 a=1rTi8g4bvmsLpnurc7XrhA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=M51BFTxLslgA:10 a=gYDgUnLjrNg4IJ_HIQUA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=w19t9apjiSXs1-J1:21 a=_PcsQSoJFxjLED8S:21 a=CjuIK1q_8ugA:10 a=uChYRsm3G7wJh8dgyGYA:9 a=B2y7HmGcmWMA:10 a=tclcd6dtLQvEqt9_mmAA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 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:171103 Archived-At: --Apple-Mail=_076F2AB6-3450-47BA-BE6E-541D2CBFC637 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 5 nov. 2019 kl. 10.35 skrev martin rudalics : > Any code based on mouse dragging should be written in such way that > the corresponding click event can be easily handed over to a separate > command. That's what the drag- prefix is for. All right, I re-wrote the patch to allow for independent use for = X-mouse-N, but... > > but doesn't it force the pop-up menu to be used with > > click-release-select-click-release instead of the quicker > > click-select-release? >=20 > Yes and I think that the former is the correct and expected behavior. > I don't use the buffer menu but if I did I were much more annoyed by > the fact that when I abandon the selection by clicking somewhere else > I get an active region which I then have to click away in a further > step. I don't think so; being able to select from a menu with a single = dragging movement is not only more ergonomic, it's the expected = behaviour of pop-up menus. mouse.el even contains a comment to that = effect: ;; By binding these to down-going events, we let the user use the = up-going ;; event to make the selection, saving a click. You can try for yourself: with the patch applied, bind M-mouse-1 to a = menu: (global-set-key [M-mouse-1] 'mouse-buffer-menu) Now a single meta-click will open the menu, and meta-drag will mark a = rectangle. This sort of multiplexing doesn't feel right, and affects = both uses negatively. For example, suppose you have marked a rectangle and change your mind. = Intuitively, you will click somewhere to make the mark go away, using = the same modifiers. But that doesn't work, because now you get a pop-up = menu. > IMHO the rule should be that non-dragging commands are always bound to > clicks (including double and triple ones) and never to a down- event. My patch now follows that rule, but it doesn't seem to solve any = problem. > And personally, I'd reserve C-drag-mouse for marking arbitrary > non-contiguous text (like, for example, Firefox does) and use > C-S-drag-mouse for marking rectangular regions. Emacs's mouse bindings seem rather haphazard and organised mainly on the = principle of first-come, enshrining a fair bit of historical baggage. = For example, there are two different buffer menus (one for font and one = for everything else). There is also the secondary selection, of which = there seems to be much fewer actual users than people who just want to = know how to disable it. We could do worse than following some conventions that have become more = or less universal, such as right-clicking (control-click on macOS) for a = context menu. That said, do you have any particular reason (precedence, ergonomics) = for suggesting control-shift? I'd rather use meta and move secondary = selection to shift-meta (say). (As before, the attached patch uses meta but that is just a placeholder = and should not be interpreted as the final word.) --Apple-Mail=_076F2AB6-3450-47BA-BE6E-541D2CBFC637 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=200d71173e6409de45629806b10cc11f6f06c7c992=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=20modifier=20is=20customisable=20and=20= defaults=20to=20meta.=0AThe=20modifier=20for=20mouse=20secondary=20= selection=20is=20now=20also=20customisable=20and=0Adefaults=20to=20nil=20= (disabled).=0A=0A*=20lisp/mouse.el=20(mouse-scroll-subr):=20Add=20ADJUST=20= argument.=0A(mouse-drag-region-rectangle):=20New.=0A= (mouse--global-with-modifiers,=20= mouse--set-secondary-selection-bindings)=0A= (mouse-secondary-selection-modifiers)=0A= (mouse--set-rectangular-region-selection-bindings)=0A= (mouse-region-rectangle-modifiers):=20New=20defcustoms=20with=20helper=20= functions.=0A---=0A=20lisp/mouse.el=20|=20150=20= ++++++++++++++++++++++++++++++++++++++++++++++++--=0A=201=20file=20= changed,=20144=20insertions(+),=206=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/mouse.el=20b/lisp/mouse.el=0Aindex=204a351f7be2..2ac9ff3e66=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-1666,11=20= +1670,40=20@@=20mouse-save-then-kill=0A=20=20=20=20=20=20=20(setq=20= mouse-save-then-kill-posn=20click-pt)))))=0A=20=0A=20=0C=0A= -(global-set-key=20[M-mouse-1]=20'mouse-start-secondary)=0A= -(global-set-key=20[M-drag-mouse-1]=20'mouse-set-secondary)=0A= -(global-set-key=20[M-down-mouse-1]=20'mouse-drag-secondary)=0A= -(global-set-key=20[M-mouse-3]=20'mouse-secondary-save-then-kill)=0A= -(global-set-key=20[M-mouse-2]=20'mouse-yank-secondary)=0A+(defun=20= mouse--global-with-modifiers=20(base=20modifiers=20command)=0A+=20=20= "Globally=20bind=20BASE=20+=20MODIFIERS=20to=20COMMAND."=0A+=20=20= (global-set-key=20(vector=20(event-convert-list=20(append=20modifiers=20= (list=20base))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= command))=0A+=0A+(defun=20mouse--set-secondary-selection-bindings=20= (mods=20activate)=0A+=20=20"Set=20global=20mouse=20bindings=20using=20= MODS=20for=20secondary=20selection.=0A+If=20ACTIVATE=20is=20nil,=20= remove=20those=20bindings."=0A+=20=20(when=20mods=0A+=20=20=20=20= (mouse--global-with-modifiers=0A+=20=20=20=20=20'mouse-1=20mods=20(and=20= activate=20'mouse-start-secondary))=0A+=20=20=20=20= (mouse--global-with-modifiers=0A+=20=20=20=20=20'drag-mouse-1=20mods=20= (and=20activate=20'mouse-set-secondary))=0A+=20=20=20=20= (mouse--global-with-modifiers=0A+=20=20=20=20=20'down-mouse-1=20mods=20= (and=20activate=20'mouse-drag-secondary))=0A+=20=20=20=20= (mouse--global-with-modifiers=0A+=20=20=20=20=20'mouse-3=20mods=20(and=20= activate=20'mouse-secondary-save-then-kill))=0A+=20=20=20=20= (mouse--global-with-modifiers=0A+=20=20=20=20=20'mouse-2=20mods=20(and=20= activate=20'mouse-yank-secondary))))=0A+=0A+(defcustom=20= mouse-secondary-selection-modifiers=20'(shift=20meta)=0A+=20=20"The=20= modifier=20keys=20for=20secondary=20selection=20using=20the=20mouse.=0A= +If=20none,=20mouse=20secondary=20selection=20is=20disabled."=0A+=20=20= :group=20'mouse=0A+=20=20:type=20'(set=20(const=20meta)=20(const=20= control)=20(const=20shift)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (const=20super)=20(const=20hyper))=0A+=20=20:version=20"27.1"=0A+=20=20= :set=20(lambda=20(variable=20new-value)=0A+=20=20=20=20=20=20=20=20=20= (when=20(boundp=20'mouse-secondary-selection-modifiers)=0A+=20=20=20=20=20= =20=20=20=20=20=20(mouse--set-secondary-selection-bindings=0A+=20=20=20=20= =20=20=20=20=20=20=20=20mouse-secondary-selection-modifiers=20nil))=0A+=20= =20=20=20=20=20=20=20=20(set-default=20variable=20new-value)=0A+=20=20=20= =20=20=20=20=20=20(mouse--set-secondary-selection-bindings=0A+=20=20=20=20= =20=20=20=20=20=20mouse-secondary-selection-modifiers=20t)))=0A=20=0A=20= (defconst=20mouse-secondary-overlay=0A=20=20=20(let=20((ol=20= (make-overlay=20(point-min)=20(point-min))))=0A@@=20-1960,6=20+1993,111=20= @@=20secondary-selection-from-region=0A=20=20=20=20=20(move-overlay=20= mouse-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=20the=20mouse=20is=20= dragged=20over.=0A+This=20must=20be=20bound=20to=20a=20button-down=20= mouse=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(setq=20= track-mouse=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;;=20Tell=20the=20rectangle=20selection=20about=20the=20= exact=20column,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20since=20= it=20might=20not=20correspond=20exactly=20to=20a=20valid=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20position=20in=20the=20text.=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20(rectangle--col-pos=20start-col=20'mark)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20(rectangle--col-pos=20start-col=20= 'point)=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20dragged=20= t))=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20(let*=20((posn=20(event-end=20= event))=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=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=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=20= mouse-pos)=20hscroll))=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(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=20= mouse-row=20(1-=20bottom)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20Drag=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(rectangle--col-pos=20mouse-col=20= 'point))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Drag=20= outside=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=20= mouse-row))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((<=20= mouse-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=20start-point=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20()=20= (rectangle--col-pos=20mouse-col=20'point))))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20((>=3D=20mouse-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=20= bottom))=20nil=20start-point=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(lambda=20()=20(rectangle--col-pos=20mouse-col=20= 'point)))))))))=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=20= old-track-mouse)=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;=20deactivate=20= rectangle=20mode.=0A+=20=20=20=20=20=20=20=20=20(deactivate-mark))))))=0A= +=0A+(defun=20mouse--set-rectangular-region-selection-bindings=20(mods=20= activate)=0A+=20=20"Set=20global=20mouse=20bindings=20using=20MODS=20for=20= rectangular=20selection.=0A+If=20ACTIVATE=20is=20nil,=20remove=20those=20= bindings."=0A+=20=20(when=20mods=0A+=20=20=20=20;;=20For=20rectangular=20= selection=20to=20work,=20down-mouse-N=20must=20be=20bound=20to=0A+=20=20=20= =20;;=20`mouse-drag-region-rectangle',=20and=20drag-mouse-N=20to=20= ignore.=0A+=20=20=20=20;;=20mouse-N=20can=20be=20bound=20to=20anything=20= but=20`mouse-set-selection'=20is=0A+=20=20=20=20;;=20probably=20the=20= most=20ergonomic=20binding.=0A+=20=20=20=20(mouse--global-with-modifiers=20= 'down-mouse-1=20mods=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(and=20activate=20= 'mouse-drag-region-rectangle))=0A+=20=20=20=20= (mouse--global-with-modifiers=20'drag-mouse-1=20mods=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(and=20activate=20'ignore))))=0A+=0A+(defcustom=20= mouse-region-rectangle-modifiers=20'(meta)=0A+=20=20"The=20modifier=20= keys=20for=20rectangular=20region=20selection=20using=20the=20mouse.=0A= +If=20none,=20mouse=20rectangular=20region=20selection=20is=20disabled."=0A= +=20=20:group=20'mouse=0A+=20=20:type=20'(set=20(const=20meta)=20(const=20= control)=20(const=20shift)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (const=20super)=20(const=20hyper))=0A+=20=20:version=20"27.1"=0A+=20=20= :set=20(lambda=20(variable=20new-value)=0A+=20=20=20=20=20=20=20=20=20= (when=20(boundp=20'mouse-region-rectangle-modifiers)=0A+=20=20=20=20=20=20= =20=20=20=20=20(mouse--set-rectangular-region-selection-bindings=0A+=20=20= =20=20=20=20=20=20=20=20=20=20mouse-region-rectangle-modifiers=20nil))=0A= +=20=20=20=20=20=20=20=20=20(set-default=20variable=20new-value)=0A+=20=20= =20=20=20=20=20=20=20(mouse--set-rectangular-region-selection-bindings=0A= +=20=20=20=20=20=20=20=20=20=20mouse-region-rectangle-modifiers=20t)))=0A= +=0A+=0C=0A=20(defcustom=20mouse-buffer-menu-maxlen=2020=0A=20=20=20= "Number=20of=20buffers=20in=20one=20pane=20(submenu)=20of=20the=20buffer=20= menu.=0A=20If=20we=20have=20lots=20of=20buffers,=20divide=20them=20into=20= groups=20of=0A--=20=0A2.21.0=20(Apple=20Git-122)=0A=0A= --Apple-Mail=_076F2AB6-3450-47BA-BE6E-541D2CBFC637 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_076F2AB6-3450-47BA-BE6E-541D2CBFC637--