all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie<none@example.invalid>
Subject: Re: M-x indent-region not working (?)
Date: Mon, 11 Aug 2003 18:12:03 +0000	[thread overview]
Message-ID: <j9m8hb.rh.ln@acm.acm> (raw)
In-Reply-To: 6d7a61c9.0308110703.701e22d0@posting.google.com

guanxi <guanxi_i@yahoo.com> 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").

  parent reply	other threads:[~2003-08-11 18:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-08 17:36 M-x indent-region not working (?) guanxi
2003-08-08 19:03 ` Kai Großjohann
2003-08-11 14:56   ` guanxi
2003-08-08 20:10 ` Barry Margolin
2003-08-11 15:03   ` guanxi
2003-08-11 16:13     ` Stefan Monnier
2003-08-12 18:45       ` Kai Großjohann
2003-08-11 18:12     ` Alan Mackenzie [this message]
2003-08-12  2:12       ` guanxi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=j9m8hb.rh.ln@acm.acm \
    --to=none@example.invalid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.