From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: M-x indent-region not working (?) Date: Mon, 11 Aug 2003 18:12:03 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <6d7a61c9.0308080936.244dbc97@posting.google.com> <6d7a61c9.0308110703.701e22d0@posting.google.com> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1060639285 10342 80.91.224.253 (11 Aug 2003 22:01:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2003 22:01:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 12 00:01:24 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19mKjD-0002w8-00 for ; Tue, 12 Aug 2003 00:01:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19mKim-0001Hr-J9 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2003 18:00:56 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!195.40.4.120.MISMATCH!easynet-quince!easynet.net!feed.news.nacamar.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1060638320 12878 193.149.49.134 (11 Aug 2003 21:45:20 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 11 Aug 2003 21:45:20 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:115813 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11731 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11731 guanxi wrote on 11 Aug 2003 08:03:07 -0700: > What *is* indent-region doing? Can anyone define it? indent-region is really for indenting in _programming_ modes. For example, after doing a bit of yanking in some Emacs lisp code, a code fragment might look like this: (if (> count 0) (if (< (point) here) (setq count (1- count)) (goto-char (car range)) (setq range nil)) The middle three lines need to be indented further to the right than the first line. Correcting indentation by hand (as has to be done in many proprietary "programmers'" editors) is mind-numbingly tedious. By setting the region around these lines and doing indent-region (with the keys C-M-\) it would end up looking like this, as it should: (if (> count 0) (if (< (point) here) (setq count (1- count)) (goto-char (car range)) (setq range nil)) It's difficult to see exactly what you're expecting indent-region to do in a text mode, since text doesn't have an indentation structure like programming languages do. Could it be you're looking for something like Outline Mode? -- Alan Mackenzie (Munich, Germany) Email: aacm@muuc.dee; to decode, wherever there is a repeated letter (like "aa"), remove half of them (leaving, say, "a").