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: TAB when the region is active Date: Wed, 19 Sep 2007 07:34:15 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1190212752 28192 80.91.229.12 (19 Sep 2007 14:39:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2007 14:39:12 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 19 16:39:02 2007 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 1IY0ev-0001Hj-O9 for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2007 16:36:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IY0es-0000sL-Ji for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2007 10:36:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IY0df-0000TN-BG for emacs-devel@gnu.org; Wed, 19 Sep 2007 10:34:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IY0dd-0000SZ-Fn for emacs-devel@gnu.org; Wed, 19 Sep 2007 10:34:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IY0dd-0000SL-3A for emacs-devel@gnu.org; Wed, 19 Sep 2007 10:34:49 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IY0db-0000aU-Th for emacs-devel@gnu.org; Wed, 19 Sep 2007 10:34:48 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l8JEYgcK016576 for ; Wed, 19 Sep 2007 09:34:42 -0500 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 l8ICJOrF031086 for ; Wed, 19 Sep 2007 08:34:41 -0600 Original-Received: from dhcp-amer-csvpn-gw1-141-144-66-217.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3225549531190212439; Wed, 19 Sep 2007 07:33:59 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 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:79314 Archived-At: > > 1. `indent-region' only indents lines that start within the > region. There's > > If TAB with an active region should indent the region it should do it by > calling indent-region. > Whether indent-region does the right thing or not or is another issue. Maybe. Depends on what you intend the region for in this context, and what you use it for in indent-region. The two are not necessarily the same. I don't know whether indent-region DTRT in general, as I don't know exactly what it was intended to do. I described some behavior that to me is not TRT in this context, but perhaps that behavior is correct in other contexts. (And I mentioned some behavior that looks like it might be a bug for the general context also, but, again, I don't know the exact intention behind indent-region.) TRT for TAB with a region active can be different, depending on whether you want to indent the complete _lines_ that are touched by a region or you want to indent precisely the region (which indent-region seems to do). I can imagine a use for each behavior. It is not because a function is named "indent-region" that it is necessarily precisely what should be used for a particular key binding (TAB) when the region is active. I prefer the indent-each-line-in-the-region behavior for this context. You might prefer the existing indent-region behavior or even some third behavior. The existence of a function that does some indenting using the region does not preclude the creation of a different function for a different indenting behavior that also involves the region. What I was describing was indenting complete lines, and using the region to, in effect, identify those lines. That is the behavior that I would like to see for TAB when a region is active. But that might not be TRT generally for an indent-region command (I don't know). So, while it seems to make sense, in general, that indent-region should be applicable when doing some indenting that involves the region, I don't agree that it is the most appropriate behavior in this specific case. At least not its current behavior. And I'm not sure that the behavior that I prefer in this context (indent all lines overlapping the region, in succession) should replace the current behavior as the definition of indent-region. I doubt it, in fact, as I imagine that there are good reasons for the existing behavior.