From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Why was `transient-mark-mode' turned off for `delete-selection-mode'? Date: Fri, 5 Sep 2014 09:01:58 -0700 (PDT) Message-ID: <1e534a9c-cc81-4bd6-ab28-8427de9e07bf@default> References: <60d75d3a-d04c-4394-800b-60b65fafdb11@default> <2ffbe01d-ef46-4467-83a6-4714a192ba8b@default> <3b045884-0f98-49f3-addd-227a3c1403d1@default> <53f0f206-96ae-423b-a237-294a26f60270@default> <87ppfa1rdi.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1409932952 14986 80.91.229.3 (5 Sep 2014 16:02:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Sep 2014 16:02:32 +0000 (UTC) To: David Kastrup , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 05 18:02:24 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XPvxw-0005qc-3Z for ged-emacs-devel@m.gmane.org; Fri, 05 Sep 2014 18:02:24 +0200 Original-Received: from localhost ([::1]:58773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvxv-0001dq-Cz for ged-emacs-devel@m.gmane.org; Fri, 05 Sep 2014 12:02:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvxi-0001Mr-Hy for emacs-devel@gnu.org; Fri, 05 Sep 2014 12:02:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPvxZ-000180-Nq for emacs-devel@gnu.org; Fri, 05 Sep 2014 12:02:10 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:34977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvxZ-00017u-Fe; Fri, 05 Sep 2014 12:02:01 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s85G20Wh027181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Sep 2014 16:02:00 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s85G1xnE029462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Sep 2014 16:01:59 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s85G1wTm023340; Fri, 5 Sep 2014 16:01:58 GMT In-Reply-To: <87ppfa1rdi.fsf@fencepost.gnu.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174041 Archived-At: > > 2. There are now 4 possible behaviors that a user can choose: > > a. d-s mode on and t-m mode on > > b. d-s mode off and t-m mode on > > c. d-s mode off and t-m mode off > > d. d-s mode on and t-m mode off > > > > This is a good time to again consider the question of > > what the default behavior should be. It is currently (b). > > I think it should be (a). > > > > (a) is the behavior most new users are used to. It is the > > behavior I have preferred for Emacs, ever since it was first > > available, 20 or so years ago. > > (b) is the behavior we have now. >=20 > I think it shouldn't. OK. > > I think (a) is the best choice for the default behavior, > > and (d) is arguably the second best choice. >=20 > I find myself trying to figure out a good way to unhighlight a > selection half of the time when I am trying to edit a link in a > browser or something that pops up highlighted for some reason. > It is total nuisance behavior without a generally available way > to turn the unasked-for selection off. The other half of the time > I inadvertantly delete material. Sometimes it can be recovered > by C-z (depending on the application). Sometimes not. Clearly, d-s mode is not for you. Fortunately, anyone can choose the behavior (a-d) that s?he prefers. But I wonder if your surprise and annoyance with such behavior outside Emacs might have something to do with your not using d-s mode inside Emacs. I use d-s mode, and I am not surprised outside Emacs by a highlighted selection or its deletion if I hit a deletion key or its replacement if I type text. And that's a point in favor of turning on d-s mode by default: it is quite common UI outside Emacs. > Your only argument so far has been "others do it". But that's not, > in itself, a good reason to let Emacs adopt default behavior that > gets in the way of productive work. =20 I agree 100% that how things work outside Emacs should not be the *only* reason for how they should work inside Emacs. I have opposed turning on CUA mode by default, for instance. Just as you find d-s mode off more natural and less conducive to mistakes, so I find the opposite. People are different, and they have different habits and use cases. Each of us probably thinks that what seems natural for us personally makes for a good default setting, at least in this case. But the same thing was true for the discussion about t-m mode. Plenty of people argued strongly about the annoying distraction of highlighting; the naturalness of an invisible region and the absence of any concept of "active" region; and so on. It was a long discussion, but we finally turned `transient-mark-mode' on. I admit that I don't have a particular, killer argument in favor of d-s by default. Like you in the opposite direction, I can argue that its particulars are helpful and say why, etc. But in this case I'm not sure that will get us far. Everyone is likely already familiar with the differences, which can be described either postively or negatively without adding much light. The same was true for t-m mode. A "user poll" might be useful in this case. > "Now how do I undo that damage" _is_ a distraction from whatever > you have been doing. I do get this in Emacs when accidentally typing > C-w (rather than C-e or something). But typing C-w accidentally does > not occur as frequently as, well, typing anything at all. Which is a strong argument against having type-to-replace without highlighting the text to be replaced/deleted. (Which was what I mistakenly thought the new d-s NEWS entry was announcing.) I don't see accidentally deleting a highlighted region as a problem, but if you say it happens to you (don't you see the highlighting?) then, again, I would guess that maybe the problem is at least partly that you are between two chairs: you are used to Emacs without d-s, and then you encounter type-to-replace outside Emacs. [FWIW, I bind `kill-region' & company (e.g. `clipboard-kill-region') to a command that makes me `y-or-n-p' the killing if the region is greater than a given size - 2000 chars by default. Dunno whether that would be useful for Emacs generally. But it helps me, especially since even though the region is highlighted, and the highlighting is always visible (since point is on screen), the extent of a large region is not so obvious. I also show the region size in the mode line in chars and lines, using face`region': "2962 ch, 62 l".] Similarly, I don't see things "popping up highlighted for some reason" (either outside Emacs or with d-s mode) and having a need to unhighlight them. But if I did, it would not be a big deal to unhighlight them (C-g in Emacs). Well, OK, maybe I do see that sometimes. E.g., if I click the URL in the address field of a browser it typically becomes selected and highlighted, so that I can quickly replace it. What do I do if I want to keep 95% of it? I click mouse-1 where I want to change it, or I use a cursor key, and the highlighting disappears. Poof! No swearing. But I am used to the behavior. Now of course, if for some reason you don't notice that the text is selected - you don't notice the highlighting, then perhaps you will be in for some swearing. But as you say, `C-z' (undo) usually reverts any deletion or replacement. Again, a problem for you and some others, no doubt, but not for yet others. > > But even then many of them interact with programs (e.g. > > web browsers) that have the behavior of (a). >=20 > In my case, that interaction involves a lot of swearing. See above. My guess is that that is a consequence mainly of not being used to the behavior, due to not using the same behavior within Emacs. Precisely the argument I was making. Some people are very used to the type-to-replace behavior outside Emacs, and they no doubt engage in similar swearing when they step inside Emacs. Others, like you, though not used to it, might benefit from the behavior being the same (or similar) inside and outside Emacs - less swearing. > > 3. Besides having the limitation of not being able to just > > type to replace the region text, the current situation > > suffers from treating mouse selection exceptionally. > > A mouse selection has the deletion behavior of d-s mode, > > but without its type-to-replace behavior. >=20 > Are you sure about that? Like, really sure? Well, let's see (I'm on MS Windows; YMMV): 1. emacs -Q (any Emacs version you like). 2. In *scratch*, select some text with the mouse. Take your pick how you do this: drag mouse-1 or double-click it, or click mouse-1 then mouse-3 elsewhere, etc. 3. Type some text. For me, the typed text is inserted at point, without any of the selected (and highlighted) text being replaced. If I hit a deletion key (e.g. Backspace or Delete) then the selected text is deleted. And that's the behavior I described. Do you see something different?