From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: delete-selection-mode as default (WAS: Some developement questions) Date: Mon, 10 Sep 2018 13:36:29 -0700 (PDT) Message-ID: References: <83k1nxvm5j.fsf@gnu.org> <87sh2ih0bp.fsf@fastmail.fm> <770f48a8-664a-40ae-8e03-19f6aad248b6@default> <20180910181615.GA4829@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536611741 25747 195.159.176.226 (10 Sep 2018 20:35:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2018 20:35:41 +0000 (UTC) Cc: hw@adminart.net, spacibba@aol.com, Joost Kremers , Noam Postavsky , emacs-devel@gnu.org, Eli Zaretskii , phillip.lord@russet.org.uk To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 10 22:35:36 2018 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 1fzSuG-0006bG-BN for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2018 22:35:36 +0200 Original-Received: from localhost ([::1]:53873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzSwM-0000EC-Uw for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2018 16:37:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzSvd-0000Dw-9E for emacs-devel@gnu.org; Mon, 10 Sep 2018 16:37:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzSvZ-00040Z-LT for emacs-devel@gnu.org; Mon, 10 Sep 2018 16:36:59 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:39580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzSvR-0003w3-H0; Mon, 10 Sep 2018 16:36:51 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8AKXVka109670; Mon, 10 Sep 2018 20:36:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=SWzwCXn7MsvDH7Y72yOoavgcSk/yLh4AMi3M3hPwC/E=; b=y3XsNF1UtrUihJ5ah5eWU5y2V7bOs44a1BqJn/wjFxSoGJyIHD7edMKxj7HgajYEz2f7 9oV0s59YsgX87oG4Sgg0P/dAKtasCrOh0pIYi75RYF02KjnktXghaOWfPNO6iBuE1/k9 Wh4yq+0Rhv3mXBCpOB1n1m/WEYbgSIcFiDo0f4Yk91g5II68xDCvk3uiMFRT1Z8fP4DE PBnvOAhleS1UAIG96hyZSc3jGQYZzVO2cIpV8BFdU+KMg0d2LbJWWY+rn50w3kj7NpaY QDhlh3lwjbKmz0oVIOexpPK7xeYhy9F50IT7gUNMqvsllSbd4Slc/qLB+5Cz3R1SoNO7 cA== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2mc6cpgb4m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Sep 2018 20:36:38 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8AKaVZ8001641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Sep 2018 20:36:32 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8AKaUWm013264; Mon, 10 Sep 2018 20:36:31 GMT In-Reply-To: <20180910181615.GA4829@ACM> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9012 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809100202 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.78 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:229652 Archived-At: > Actually, I'm not sure what the use of d-s-mode actually is. I don't > recall anyone here advocating it on some intrinsic merits, only "because > everybody else does it", which I've never found a convincing argument for > anything in Emacs. Minor convenience. If the region is active then typing or yanking replaces it - no need to use `C-w' first. That's all. Not a big deal either way, IMO (as Stefan has said). When the region is active you can do things to it or with it. Otherwise, there is _no reason to activate it_. If it is active, one of the things you often want to do with it is delete it or replace it. We tend to do that often, and d-s-m mode makes that easier/quicker. Nothing more. Think of overwrite mode (bound to ) versus inserting and having to use `C-d' before or after each char you type. No, of course you wouldn't use `C-d' for each char, but that's the idea. The more often you had to compensate for insertion by deleting what was there beforehand, the more you might find overwrite mode handy. If you often replace selected text then not bothering to use `C-w' first can be handy. Select some text, then type or yank to replace it. > That was me, the complete phrase was "irretrievably lost" and I carefully > outlined what was being lost and where. In summary, it was a carefully > and painstakingly constructed region, and what was being lost by a > careless movement key without was the point and mark of the > highlighted region, not its contents. Furthermore it was in programs > which aren't Emacs. I see. I never use shift-selection. Dunno whether that's relevant - probably not. > It enables you to type onto the end of a (highlighted) region > without being distracted by first having to do something to remove the > highlighting,=20 Yes. If someone doesn't want to do something to/with the active region then it shouldn't be active. `C-g' deactivates it. In a way, d-s-m or not d-s-m is a bit about C-g versus C-w. Which do you need to use more often, C-w (without d-s-m) or C-g (with d-s-m). That might be one way of looking at the choice people make. > or more likely without first having to use `undo' to get > your region back again, followed by unhighlighting it followed by typing > the character you want to append. You shouldn't be losing the region in the first place. You shouldn't need to undo or unhighlight. If you accidentally activated the region, and you want to deactivate it, C-g should take care of that. I'm guessing this comes back to the `C-x C-x' activation of the region. With that turned off, i.e., with `C-x C-x' just swapping point and mark like it did in the old days, I'm guessing you will never have an active region that bothers you - with or without d-s-m. But that's just a guess. Users should not get an active region when they don't want it, i.e., when they don't want to act on the region. And they should be able to easily get an active region when they do want to act on the region. If we're not yet supporting that well then that's where the improvement should come first, I think. The only time I get an active region when I don't want it is if I activated it thinking I was going to do something with it, and then I changed my mind (so I use C-g). I suspect that things are very different for you, and I suspect it is because of `C-x C-x' activating the region even though you have no intention of acting on it. An active region is perhaps more of a bother than an aid, for someone who never (or rarely) wants to act on it. I feel like region activation by `C-x C-x' was maybe foisted on people who never wanted or expected to do anything with an active region. If so, they've probably been silently tolerating it all these years. And yes, I can see why, if that's the case, they might dread moving to d-s-m. I think we've finally identified the real problem underlying such anxiety as being region activation by `C-x C-x'. Take that away and I think folks who don't want to use d-s-m will be fine. For folks who do want to use d-s-m, region activation by `C-x C-x' is handy. But it's not necessary. In any case, region activation has nothing inherently to do with swapping point and mark. Maybe someone who detests d-s-m could spend a few minutes with it turned on but with `C-x C-x' bound to a command that just swaps point and mark without activating the region. My guess is that if that were the default behavior it might be OK for most people. D-s-m, but without Emacs activating the region each time you use `C-x C-x'. No undesired region activation, so no unexpected d-s-m action. And of course, for someone who really wants to take advantage of d-s-m we still would offer the current, region-activating `C-x C-x' command. But we should also offer a command that just activates the region, nothing more. By default that would be unbound (or at most bound to something other than `C-x C-x'). > Personally, it scarcely affects me because I run with transient-mark-mode > disabled,=20 There you go. That's probably the right thing to do for someone who doesn't want d-s-m behavior. But then do you have to monkey around with temporary t-m-m, or do you just not bother, ever, with having an active region? I'm guessing the latter. > but I still occasionally get unwanted highlighting of regions > for some reason. Probably from accidental temporary t-m-m, would be my guess. (That's something else I never use.) Or maybe from some other commands that activate the region? I think that if t-m-m is off then most commands (e.g. query-replace) do not try to activate the region (which is correct behavior - an active region makes sense only for t-m-m/d-s-m). In sum, having d-s-m + t-m-m both on is good for folks like me. Having them both off is maybe good for folks like you. Having t-m-m on and d-s-m off might not be the best thing. But that's the default behavior.