From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.devel Subject: Re: visual-region-mode? Date: Mon, 24 Sep 2018 19:42:50 +0200 Message-ID: References: <877ejxsm18.fsf@toy.adminart.net> <874lf0oul4.fsf@toy.adminart.net> <877ejuabdt.fsf_-_@toy.adminart.net> <878t473dhg.fsf@toy.adminart.net> <87pnxii2b7.fsf@toy.adminart.net> <87k1nm7eit.fsf@toy.adminart.net> <878t403dn5.fsf@toy.adminart.net> <878t3yv0p0.fsf@toy.adminart.net> <87d0t9ckzl.fsf@toy.adminart.net> <87a7oa1toa.fsf@toy.adminart.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1537810765 22714 195.159.176.226 (24 Sep 2018 17:39:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2018 17:39:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: hw Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 24 19:39:21 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 1g4UpL-0005pO-Kj for ged-emacs-devel@m.gmane.org; Mon, 24 Sep 2018 19:39:20 +0200 Original-Received: from localhost ([::1]:46304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4UrS-0006xp-As for ged-emacs-devel@m.gmane.org; Mon, 24 Sep 2018 13:41:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4Uqb-0006wA-RY for emacs-devel@gnu.org; Mon, 24 Sep 2018 13:40:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4UqX-0000rs-Ms for emacs-devel@gnu.org; Mon, 24 Sep 2018 13:40:37 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:54566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4UqV-0000m9-4U for emacs-devel@gnu.org; Mon, 24 Sep 2018 13:40:31 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 6608022866 for ; Mon, 24 Sep 2018 17:44:10 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1537811047; x=1538675048; bh=21Tgxt5B9AEXj W+1j4zKybSlUkhUyMqCEd7md7q27sw=; b=Hpw68PE1hjpPRSQVfDVnbfg2+TBi7 LOKnqYrsW6LYG0HmPlfgizOTKJzi7CQG3RxcnhSCdMNllBZvN7/g+DNhwDRLNl1I G6ESvSiqEzIH4uihmvZOpF3jBPGkHONNSHMG399UXaUYrlVxCGT8rnm3POjNqPPC LKMsEfs4ED89Cc= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eNV7nSGwgNba for ; Mon, 24 Sep 2018 17:44:07 +0000 (UTC) Original-Received: from gray (unknown [IPv6:2a02:1205:c693:2d60:c62c:3ff:fe30:b864]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 2DBCB22854; Mon, 24 Sep 2018 17:44:07 +0000 (UTC) In-reply-to: <87a7oa1toa.fsf@toy.adminart.net> (message from hw on Fri, 21 Sep 2018 22:28:53 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 37.35.109.145 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:230030 Archived-At: > From: hw > Date: Fri, 21 Sep 2018 22:28:53 +0200 > > > There would be a way to "fortify" the region, if you had another > > binding for toggling whether the region is active or not. > > Without t-m-m, the region can not become active. Yes, but since we have commands that offer behavior specific to active regions, we have the so-called "temporary transient mark mode" -- which is a hack to get around this problem. I'd rather have a way to explicitly activate/deactivate the region. > >> With t-m-m disabled, the region can not be activated, so why would I try > >> to do that? My function is ignorant of t-m-m anyway. > >> > >> Why would I disable t-m-m only to ask to temporarily enable it? > > > > That's how the current implementation is designed: the region is > > considered "active" when both "mark-active" is non-nil /and/ "t-m-m" > > is on. > > That doesn't explain why I would disable t-m-m. No, it explains why you would temporarily enable it after disabling it permanently. > Perhaps there is a way to disable the highlighting. I haven't found out > how something is highlighted. It's possible to disable the highlighting by customizing the "region" face. > > and without the region randomly deactivating itself after certain > > commands as it does with "t-m-m" switched on. > > [...] > > Are you referring to commands deactivating the region? Yes. See the doc of "t-m-m": The mark is "deactivated" by changing the buffer, and after certain other operations that set the mark but whose main purpose is something else--for example, incremental search, M-<, and M->. > That could be > configurable, though I'm not sure how useful it is to indefinitely do > something with a region until it is explicitly deactivated. That's how the region works with "t-m-m" off: you can always invoke a sequence of commands that use the region, without having to think about whether it's active. I'd like to be able to carry this behavior over to commands that require an active region for certain things, like M-% does for replacing inside a region. > > Highlighting the region could be a separate mode. > > Highlighting the region all the time is probably not very useful. Yes, but the user knows best, IMO. The default would still be the same behavior as it is now. > >> Are there any disadvantages of having t-m-m enabled that would overcome > >> all the advantages of having it disabled? > > > > Not sure I understand this. > > Disabling t-m-m doesn't make any sense at all. Why would anyone disable > it? > > I can see it for someone who doesn't like the highlighting, so if it was > configurable --- and it is amazing that is isn't --- whether to > highlight the region when it's active or not, everyone who dislikes the > highlighting could have t-m-m enabled. I would remove having it > disabled entirely from Emacs because there is no point in that and only > complication. I think the main point of contention is C-x C-x: it activates the mark by default, which is irritating when you're using the mark for navigation. Even if you disable the highlighting of the region, certain commands will behave differently in response to the region being active. You've already posted an improved version of C-x C-x that does not activate the mark by default: I think that is the right way to go, as well as a new command for explicitly activating/deactivating the mark. With these two fixes, much of the contention surrounding "t-m-m" should go. > Without highlighting, a different indicator could be useful to show > whether the region is active or not, like a hint in the mode line. Yes, offering an indicator in the mode line to show whether the region is active would be a good start. Btw, I'm culling most of the CC list since it seems no longer relevant.