emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: TAB when the region is active


From: Drew Adams
Subject: RE: TAB when the region is active
Date: Wed, 19 Sep 2007 07:34:15 -0700

> > 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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]