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: Tentative diagnosis of TMM's problem. [Re: Enabling TransientMarkMode by default] Date: Thu, 21 Feb 2008 01:43:45 -0800 Message-ID: <002801c8746e$413695a0$0600a8c0@us.oracle.com> References: <20080220200142.GA1979@muc.de><006e01c8740e$366ebbd0$c2b22382@us.oracle.com> <20080221081923.GB1891@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1203590458 22515 80.91.229.12 (21 Feb 2008 10:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Feb 2008 10:40:58 +0000 (UTC) Cc: rms@gnu.org, 'Sascha Wilde' , lennart.borgman@gmail.com, emacs-devel@gnu.org, juri@jurta.org, dann@ics.uci.edu, 'Stefan Monnier' , storm@cua.dk, 'Miles Bader' To: "'Alan Mackenzie'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 21 11:41:21 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JS8rg-0001IH-J6 for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2008 11:41:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JS8rB-0001yR-FD for ged-emacs-devel@m.gmane.org; Thu, 21 Feb 2008 05:40:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JS80F-0004So-Tu for emacs-devel@gnu.org; Thu, 21 Feb 2008 04:46:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JS80C-0004S7-NN for emacs-devel@gnu.org; Thu, 21 Feb 2008 04:46:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JS80A-0004Rs-7U for emacs-devel@gnu.org; Thu, 21 Feb 2008 04:46:02 -0500 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JS802-0001Pj-L5; Thu, 21 Feb 2008 04:45:55 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m1L9jbFE029159; Thu, 21 Feb 2008 02:45:37 -0700 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1L7Dl6k005150; Thu, 21 Feb 2008 02:45:36 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3584453601203587027; Thu, 21 Feb 2008 01:43:47 -0800 Original-Received: from dradamslap1 (/141.144.81.25) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Feb 2008 01:43:46 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ach0YRVqQpn5L2xcRt22v1PCyMbvmQAAiHXw In-Reply-To: <20080221081923.GB1891@muc.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-Mailman-Approved-At: Thu, 21 Feb 2008 05:40:32 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89812 Archived-At: > Hi, Drew! Hi Alan. > > ....but the region is not active, so no highlighting. ...., if you > > have `mark-even-if-inactive' = t. > > Why the "so" in "so no highlighting"? > I'm beginning to think that this is tautological (see below). I'm no expert, but my understanding is no, it's not (see below). > I'm beginning to think that people say "highlight a region" > (particularly in non-Emacs programs) when they really mean > "create a region". I think I've seen Lennart doing this > (hi, Lennart!). This lack of precision is unhelpful. Lack of precision can be confusing, yes. Part of the difficulty about speaking of this stuff without taking the extra words needed to clarify the context is that different vocabulary is used in different contexts. In particular, some of the discussion was about what people are used to doing in other editors, where the terminology and behavior are different from Emacs. My understanding is the following. In Emacs: 1. As soon as you have set mark at least once, there is a region. The region continues to exist for the rest of your Emacs session. It can be empty (point = mark), but it is never destroyed. 2. Transient mark mode has a notion of active and inactive region (but the region always exists - see #1). If you don't use t-m mode or one of its derivatives such as delete-selection mode, then this distinction is not important to you. 3. If you do use t-m mode: (a) You can activate and deactive the region. This is, BTW, the same thing as activating and deactivating the mark. (b) When the region is active, it is highlighted; when it is deactivated, it is unhighlighted. (c) Commands such as C-SPC and C-x C-x activate the region. Some other commands deactivate it. The command loop also deactivates it, normally. 4. In t-m mode, some commands act differently, depending on whether the region is active. For example, `query-replace' limits itself to the active region; if the region is not active, then it acts on the whole buffer. 5. If you set option `mark-even-if-inactive' to non-nil, then you can always use the region, even in t-m mode, and even when it is inactive. This option has no effect unless you use t-m mode. What's the point of #5, and isn't #5 confusing? Let me take the second part first. Yes, it might confuse someone who doesn't know what to expect (which is presumably why the default value is nil), because many commands that act on the region will affect the region even if it is inactive and therefore invisible. That could be disconcerting to a newbie, in particular. But it can be handy for many Emacs users, I think. And it would become more important with my suggestion - see below. So what's the point of #5? Why have a notion of active/inactive, and why make the region visible only some of the time, if you can still act on the inactive, invisible region? This is near the crux of what we've been debating, I think. IMO, there are different use cases. Some people, I think, argue for one use case, and others argue for the other use case. Both can be useful. One use case is for operations that specifically are meant to act on the active region. These are operations such as `query-replace' that offer different actions depending on the active/inactive status, or they could be operations (none comes to mind) for which it makes sense to show you (via highlighting or bouncing the cursor) where the region is before you act on it. Typically, these operations act on fairly large chunks of text, IMO. The other use case is for all other region operations - operations for which there is no special region vs buffer difference of behavior, and for which you don't need or care to see the region before you whack it in some way. These operations act on regions of all sizes, but on average they probably act on smaller regions. If you want to delete a word or two, you just set the region appropriately and then kill it. Many Emacs users don't use t-m mode, so there is no distinction and only one use case for them (the second one, above). In particular, they cannot take advantage of the double-duty that commands such as `query-replace' offer. Many other Emacs users do use t-m mode, but they leave `mark-even-if-inactive' = nil, so they do not take advantage of the first use case above. Even some t-m mode users who set `mark-even-if-inactive' = t never or seldom, I suspect, take advantage of operations on the inactive region. And in fact, in t-m mode, the region is active a good part of the time, so those users don't lose much. Each time you hit C-SPC, for instance, you activate the region. Some people find it annoying that in cases like this (C-SPC followed by simple cursor movement) the region is highlighted. Even some people who choose to use t-m mode feel this way. In particular, since C-SPC is often used to set multiple marks for navigation, when you are doing that you are not really trying to redefine the region (though that's what you are doing), and you are especially not really intending to activate (and so highlight) the region. Others might disagree with my summary, but I hope it helps. What I threw out as a suggestion is to let users who choose so get rid of some of the annoying highlighting for t-m mode by accepting to explicitly activate the region whenever they want to use active-region operations. The change would be to simply not let C-SPC activate the region. This would be, I think, for users who are midway between the two groups mentioned - users who would like some of the advantages of each approach: 1. They would get the active/inactive distinction of today's t-m mode, for things such as `query-replace'. But they would have to do something (e.g. C-x C-x once or twice) to activate the region first for that. 2. They would not get the annoyance of so much highlighting, because the region would not be activated automatically by C-SPC. They would get the active region and its highlighting only on demand. 3. Such users would likely set `mark-even-if-inactive' = t, so they could still use the region without activating it. They would not need or care to see it highlighted for the simple operations. (And they could always activate it whenever they did care.) I didn't state it as part of my suggestion, but I think now that it would be desirable for this behavior to be optional. You would set a new option `set-mark-activates-region-flag' to nil, to stop C-SPC from activating the mark. > > FWIW, I have `mark-even-if-inactive' = t, which means I can > > always use the region, but I can see when it is active > > (highlighting). > > I've now become thoroughly confused as to what an "active" > region is. If `mark-even-if-inactive' is t, I think > "active" has become equivalent to "highlit". > Somebody please unconfuse me as appropriate! They are not equivalent, but only the active region is highlighted, and it is always highlighted. The important distinction for activation, IMO, is the difference in behavior of some commands, such as `query-replace'. But yes, highlighting is also an important attribute of the active region. HTH. But be prepared for another, counter opinion from some quarter. ;-)