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#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective Date: Thu, 31 Oct 2019 17:04:41 +0100 Message-ID: <4E95A327-1B10-46FA-B08F-1877417230A8@acm.org> References: <3311689D-B1DF-4BAC-86BA-E3D2C6D2ECF1@acm.org> <94D2DE0C-8BD0-4CCF-B77D-5606A1D227DD@acm.org> <5be797bb-9d6b-cebe-edf4-21b4a5944595@gmx.at> <60b5bfa7-0aaf-40c0-3a1d-d0c0c5c662c6@gmx.at> <354ABF35-C5D0-4045-B9F0-5615A64408E6@acm.org> <83k199nasx.fsf@gnu.org> <83ftjxn94q.fsf@gnu.org> <37DDF48D-FC37-47A8-8CEC-C6EB66AB2BF7@acm.org> <9FE0E2D6-E4EA-4D7C-871C-3483AC53B295@acm.org> <41286005-259E-4B78-A1FF-746E7A753FB4@acm.org> <83d0ednfcb.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_DFBB248B-8B3F-47CE-B1FE-7CECC4C5AE6F" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="226501"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37700@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp, homeros.misasa@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 31 17:38:13 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 1iQDSd-000wk2-OW for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2019 17:38:12 +0100 Original-Received: from localhost ([::1]:52564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQDSc-0002PQ-Ey for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2019 12:38:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35127) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQCwZ-000684-JT for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 12:05:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQCwY-0006hU-Db for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 12:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQCwY-0006hM-9b for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 12:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQCwY-0001eZ-2V for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 12:05:02 -0400 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, 31 Oct 2019 16:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37700 X-GNU-PR-Package: emacs Original-Received: via spool by 37700-submit@debbugs.gnu.org id=B37700.15725378906324 (code B ref 37700); Thu, 31 Oct 2019 16:05:02 +0000 Original-Received: (at 37700) by debbugs.gnu.org; 31 Oct 2019 16:04:50 +0000 Original-Received: from localhost ([127.0.0.1]:54108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQCwL-0001dv-QU for submit@debbugs.gnu.org; Thu, 31 Oct 2019 12:04:50 -0400 Original-Received: from mail226c50.megamailservers.eu ([91.136.10.236]:45628 helo=mail36c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQCwJ-0001dj-TP for 37700@debbugs.gnu.org; Thu, 31 Oct 2019 12:04:49 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1572537886; bh=3tEVGKPFdyUj+u5qctW27o2mDH96aCGG5tST5RFXZp4=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=KXVROGKi+W/wde2Mp8Enj57NsF8QXb71lwrjBQY5943L05LkhAMpKOW9XzQgghuUj Avbgkb8q+3xh8uwsWvCD9ptbrMZlLsUhatE8ULXEY9UJgcUw2u5zhkNlso2/kBYCMi Y6HI1ltU6LFAU3U9RuqsGllDnKApAeI9oCZPuegY= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail36c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x9VG4fTH001161; Thu, 31 Oct 2019 16:04:43 +0000 In-Reply-To: <83d0ednfcb.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0213.5DBB061D.0068, 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=bd8Vr9HB c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=ZBOFQe2d8nedwhVVqBAA:9 a=CjuIK1q_8ugA:10 a=ncZ9vwaUYPMA:10 a=7FFjzvW99H7Qq_pC1ZMA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=B2y7HmGcmWMA:10 a=_FVE-zBwftR9WsbkzFJk:22 a=pHzHmUro8NiASowvMSCR:22 a=xoEH_sTeL_Rfw54TyV31: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:170533 Archived-At: --Apple-Mail=_DFBB248B-8B3F-47CE-B1FE-7CECC4C5AE6F Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 31 okt. 2019 kl. 15.45 skrev Eli Zaretskii : > Fine with me (I proposed something like this during the original > discussion), but please document this property in the ELisp manual. Then I apologise for misunderstanding you! Attached patch amended with changes to the manual and NEWS. --Apple-Mail=_DFBB248B-8B3F-47CE-B1FE-7CECC4C5AE6F Content-Disposition: attachment; filename=0001-Inhibit-undo-in-region-for-mouse-drag-region-bug-377.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Inhibit-undo-in-region-for-mouse-drag-region-bug-377.patch" Content-Transfer-Encoding: quoted-printable =46rom=20808f466b5f7c779c41a6e03b177906d79a16e66a=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=2031=20Oct=202019=2010:31:27=20+0100=0A= Subject:=20[PATCH]=20Inhibit=20undo-in-region=20for=20mouse-drag-region=20= (bug#37700)=0A=0A'mouse-drag-region'=20leaves=20the=20region=20active=20= around=20the=20dragged=20text,=0Aso=20a=20straight=20undo=20did=20not=20= revert=20the=20entire=20operation.=20=20To=20remedy=0Athis,=20inhibit=20= undo-in-region=20when=20the=20last=20command=20was=0Amouse-drag-region.=20= =20(Method=20suggested=20by=20Stefan=20Monnier.)=0A=0A*=20lisp/mouse.el=20= (undo-drag-region):=20Set=20the=20undo-inhibit-region=20property.=0A*=20= lisp/simple.el=20(undo):=20Inhibit=20undo-in-region=20if=20the=20last=20= command=0Ahad=20the=20undo-inhibit-region=20property=20set.=0A*=20= doc/lispref/symbols.texi=20(Standard=20Properties):=0A*=20= doc/lispref/text.texi=20(Undo):=20Document=20undo-inhibit-region.=0A*=20= etc/NEWS:=20Announce=20the=20property.=0A---=0A=20= doc/lispref/symbols.texi=20|=205=20+++++=0A=20doc/lispref/text.texi=20=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|=206=20++++++=0A=20lisp/mouse.el=20=20=20=20=20=20=20=20=20=20= =20=20|=206=20++++++=0A=20lisp/simple.el=20=20=20=20=20=20=20=20=20=20=20= |=207=20++++++-=0A=205=20files=20changed,=2029=20insertions(+),=201=20= deletion(-)=0A=0Adiff=20--git=20a/doc/lispref/symbols.texi=20= b/doc/lispref/symbols.texi=0Aindex=205d71fb39a2..6d3a89a54b=20100644=0A= ---=20a/doc/lispref/symbols.texi=0A+++=20b/doc/lispref/symbols.texi=0A@@=20= -594,4=20+594,9=20@@=20Standard=20Properties=0A=20If=20non-@code{nil},=20= this=20specifies=20the=20named=20variable's=20documentation=0A=20string.=20= =20This=20is=20set=20automatically=20by=20@code{defvar}=20and=20related=0A= =20functions.=20=20@xref{Defining=20Faces}.=0A+=0A+@item=20= undo-inhibit-region=0A+If=20non-@code{nil},=20the=20named=20function=20= prevents=20the=20@code{undo}=20operation=0A+from=20being=20restricted=20= to=20the=20active=20region,=20if=20@code{undo}=20is=20invoked=0A= +immediately=20after=20the=20function.=20=20@xref{Undo}.=0A=20@end=20= table=0Adiff=20--git=20a/doc/lispref/text.texi=20b/doc/lispref/text.texi=0A= index=20ac444f6afe..9f3238e8aa=20100644=0A---=20a/doc/lispref/text.texi=0A= +++=20b/doc/lispref/text.texi=0A@@=20-1451,6=20+1451,12=20@@=20Undo=0A=20= This=20function=20does=20not=20bind=20@code{undo-in-progress}.=0A=20@end=20= defun=0A=20=0A+Some=20commands=20leave=20the=20region=20active=20after=20= execution=20in=20such=20a=20way=20that=0A+it=20interferes=20with=20= selective=20undo=20of=20that=20command.=20=20To=20make=20@code{undo}=0A= +ignore=20the=20active=20region=20when=20invoked=20immediately=20after=20= such=20a=20command,=0A+set=20the=20property=20@code{undo-inhibit-region}=20= of=20the=20command's=20function=0A+symbol=20to=20a=20non-nil=20value.=0A= +=0A=20@node=20Maintaining=20Undo=0A=20@section=20Maintaining=20Undo=20= Lists=0A=20=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= ee73d2414b..030246db40=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-3102,6=20+3102,12=20@@=20in=20other=20packages=20are=20now=20= obsolete=20aliases=20of=20'xor'.=0A=20Setting=20this=20on=20the=20first=20= character=20of=20a=20help=20string=20disables=0A=20conversions=20via=20= 'substitute-command-keys'.=0A=20=0A++++=0A+**=20'undo'=20can=20be=20made=20= to=20ignore=20the=20active=20region=20for=20a=20command=0A+by=20setting=20= its=20'undo-inhibit-region'=20symbol=20property=20to=20non-nil.=0A+This=20= is=20used=20by=20'mouse-drag-region'=20to=20make=20that=20command's=20= effect=0A+easier=20to=20undo=20immediately=20afterwards.=0A+=0A=20=0C=0A=20= *=20Changes=20in=20Emacs=2027.1=20on=20Non-Free=20Operating=20Systems=0A=20= =0Adiff=20--git=20a/lisp/mouse.el=20b/lisp/mouse.el=0Aindex=20= 76fec507e7..4a351f7be2=20100644=0A---=20a/lisp/mouse.el=0A+++=20= b/lisp/mouse.el=0A@@=20-1104,6=20+1104,12=20@@=20mouse-drag-region=0A=20=20= =20=20=20(run-hooks=20'mouse-leave-buffer-hook)=0A=20=20=20=20=20= (mouse-drag-track=20start-event)))=0A=20=0A+;;=20Inhibit=20the=20= region-confinement=20when=20undoing=20mouse-drag-region=0A+;;=20= immediately=20after=20the=20command.=20=20Otherwise,=20the=20selection=20= left=0A+;;=20active=20around=20the=20dragged=20text=20would=20prevent=20= an=20undo=20of=20the=20whole=0A+;;=20operation.=0A+(put=20= 'mouse-drag-region=20'undo-inhibit-region=20t)=0A+=0A=20(defun=20= mouse-posn-property=20(pos=20property)=0A=20=20=20"Look=20for=20a=20= property=20at=20click=20position.=0A=20POS=20may=20be=20either=20a=20= buffer=20position=20or=20a=20click=20position=20like=0Adiff=20--git=20= a/lisp/simple.el=20b/lisp/simple.el=0Aindex=2029e195bca6..10aecd651f=20= 100644=0A---=20a/lisp/simple.el=0A+++=20b/lisp/simple.el=0A@@=20-2508,6=20= +2508,10=20@@=20undo=0A=20=09=20(base-buffer=20(or=20= (buffer-base-buffer)=20(current-buffer)))=0A=20=09=20(recent-save=20= (with-current-buffer=20base-buffer=0A=20=09=09=09(recent-auto-save-p)))=0A= +=20=20=20=20=20=20=20=20=20;;=20Allow=20certain=20commands=20to=20= inhibit=20an=20immediately=20following=0A+=20=20=20=20=20=20=20=20=20;;=20= undo-in-region.=0A+=20=20=20=20=20=20=20=20=20(inhibit-region=20(and=20= (symbolp=20last-command)=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(get=20last-command=20= 'undo-inhibit-region)))=0A=20=09=20message)=0A=20=20=20=20=20;;=20If=20= we=20get=20an=20error=20in=20undo-start,=0A=20=20=20=20=20;;=20the=20= next=20command=20should=20not=20be=20a=20"consecutive=20undo".=0A@@=20= -2525,7=20+2529,8=20@@=20undo=0A=20=09=09=20=20=20=20=20=20=20;;=20it=20= shows=20nothing=20else=20happened=20in=20between.=0A=20=09=09=20=20=20=20= =20=20=20(gethash=20list=20undo-equiv-table))))=0A=20=20=20=20=20=20=20= (setq=20undo-in-region=0A-=09=20=20=20=20(or=20(region-active-p)=20(and=20= arg=20(not=20(numberp=20arg)))))=0A+=09=20=20=20=20(and=20(or=20= (region-active-p)=20(and=20arg=20(not=20(numberp=20arg))))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(not=20inhibit-region)))=0A=20=20=20= =20=20=20=20(if=20undo-in-region=0A=20=09=20=20(undo-start=20= (region-beginning)=20(region-end))=0A=20=09(undo-start))=0A--=20=0A= 2.21.0=20(Apple=20Git-122)=0A=0A= --Apple-Mail=_DFBB248B-8B3F-47CE-B1FE-7CECC4C5AE6F--