From: kai.grossjohann@gmx.net (Kai Großjohann)
Subject: Re: M-x indent-region not working (?)
Date: Tue, 12 Aug 2003 20:45:15 +0200 [thread overview]
Message-ID: <84k79iyatg.fsf@slowfox.is.informatik.uni-duisburg.de> (raw)
In-Reply-To: 5l4r0oqij2.fsf@rum.cs.yale.edu
"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
> I suspect it still won't be of much use: it's difficult to know what
> indent-region should do in text-mode anyway.
Well, there was talk about indent-region doing like TAB on each
line. That's a pretty good behavior even when TAB is bound to
indent-relative.
The above is fairly obvious for the case when all lines are
flush-left to begin with, but for programming languages indentation
can also mean to shift towards the left, which indent-relative
doesn't do.
Hm.
Here is an algorithm that describes useful behavior for indent-region
together with indent-relative as the indentation function. It
assumes that the region does not start or end in the middle of a line.
* Go to beginning of first line in region.
* Do back-to-indentation.
* Remember current column. Do indent-relative. Now look by how
many columns point has moved and call that number of columns N.
* Do indent-rigidly on the other lines in the region, specifying
N as ARG (the number of columns to indent).
I guess that this behavior does not fit into the current
indent-region framework. Hm.
--
Two cafe au lait please, but without milk.
next prev parent reply other threads:[~2003-08-12 18:45 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 [this message]
2003-08-11 18:12 ` Alan Mackenzie
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=84k79iyatg.fsf@slowfox.is.informatik.uni-duisburg.de \
--to=kai.grossjohann@gmx.net \
/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.