* bug#10153: 24.0.91; behavior of TAB in text modes is different
@ 2011-11-28 8:13 Chong Yidong
2011-11-28 20:09 ` Glenn Morris
0 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2011-11-28 8:13 UTC (permalink / raw)
To: 10153
With latest trunk,
0. emacs -Q
1. M-x text-mode RET
2. M-<
3. C-SPC
4. M->
5. TAB
The text which was in the region remains unaltered by the TAB. In Emacs
23, a tab character is inserted in front of each line in the region, as
per the manual:
In text modes, TAB inserts some combination of space and tab
characters to advance point to the next tab stop. If the region is
active and spans multiple lines, it advances the first character of
each of those lines to the next tab stop. For the purposes of this
command, the position of the first non-whitespace character on the
preceding line is treated as an additional tab stop. Thus, you can
use TAB to "align" point with the preceding line.
It appears that when the region is active, TAB in text mode now tries to
indent to the previous line, i.e. it behaves like TAB in programming
modes. Is this is a new intended feature? It's certainly not
documented in NEWS.
In GNU Emacs 24.0.91.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.2.0)
of 2011-11-28 on furball
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-28 8:13 bug#10153: 24.0.91; behavior of TAB in text modes is different Chong Yidong
@ 2011-11-28 20:09 ` Glenn Morris
2011-11-29 15:17 ` Chong Yidong
0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2011-11-28 20:09 UTC (permalink / raw)
To: Chong Yidong; +Cc: 10153
Chong Yidong wrote:
> It appears that when the region is active, TAB in text mode now tries to
> indent to the previous line, i.e. it behaves like TAB in programming
> modes. Is this is a new intended feature?
I don't know. In Emacs 23, indent-region calls indent-line-function,
which is indent-relative in text mode.
In the current trunk, indent-region calls indent-according-to-mode
(since 2010-09-18), which specifically ignores indent-relative in favour
of an ad hoc indentation.
(Also the doc of indent-region does not seem to have been updated for
this change.)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-28 20:09 ` Glenn Morris
@ 2011-11-29 15:17 ` Chong Yidong
2011-11-29 15:39 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2011-11-29 15:17 UTC (permalink / raw)
To: Glenn Morris; +Cc: 10153
Glenn Morris <rgm@gnu.org> writes:
>> It appears that when the region is active, TAB in text mode now tries to
>> indent to the previous line, i.e. it behaves like TAB in programming
>> modes. Is this is a new intended feature?
>
> I don't know. In Emacs 23, indent-region calls indent-line-function,
> which is indent-relative in text mode.
>
> In the current trunk, indent-region calls indent-according-to-mode
> (since 2010-09-18), which specifically ignores indent-relative in favour
> of an ad hoc indentation.
>
> (Also the doc of indent-region does not seem to have been updated for
> this change.)
The new behavior seems to make more sense, so I guess I'll add a NEWS
item and fix the indent-region doc.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-29 15:17 ` Chong Yidong
@ 2011-11-29 15:39 ` Drew Adams
2011-11-29 20:15 ` Lennart Borgman
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2011-11-29 15:39 UTC (permalink / raw)
To: 'Chong Yidong', 'Glenn Morris'; +Cc: 10153
> >> It appears that when the region is active, TAB in text
> >> mode now tries to indent to the previous line, i.e. it
> >> behaves like TAB in programming modes. Is this is a new
> >> intended feature?
>
> The new behavior seems to make more sense, so I guess I'll
> add a NEWS item and fix the indent-region doc.
Personally, I don't use text mode that much, and I don't care, for my personal
use.
But my guess is that there will be many Emacs users who will be confused by
this, expecting TAB to indent (if not to simply insert a TAB char). Not because
that's what TAB did in the past in Emacs, but because that's more or less the
behavior many newbies are used to, from other text editors.
My crystal ball whispers to me that there will be lots more questions posed by
newbies, to which the answer will be "Deactivate the region or use `C-q TAB'."
I would suggest keeping TAB in text mode simple, not DWIM.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-29 15:39 ` Drew Adams
@ 2011-11-29 20:15 ` Lennart Borgman
2011-11-29 21:56 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2011-11-29 20:15 UTC (permalink / raw)
To: Drew Adams; +Cc: Chong Yidong, 10153
On Tue, Nov 29, 2011 at 16:39, Drew Adams <drew.adams@oracle.com> wrote:
>> >> It appears that when the region is active, TAB in text
>> >> mode now tries to indent to the previous line, i.e. it
>> >> behaves like TAB in programming modes. Is this is a new
>> >> intended feature?
>>
>> The new behavior seems to make more sense, so I guess I'll
>> add a NEWS item and fix the indent-region doc.
>
> Personally, I don't use text mode that much, and I don't care, for my personal
> use.
>
> But my guess is that there will be many Emacs users who will be confused by
> this, expecting TAB to indent (if not to simply insert a TAB char). Not because
> that's what TAB did in the past in Emacs, but because that's more or less the
> behavior many newbies are used to, from other text editors.
Are not most users now used to web browsers (where TAB move to next
field) or programs like LibreOffice? In the latter TAB moves to next
tab stop. Most users probably never use a simple text editor today.
So I suggest TAB stop should indent.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-29 20:15 ` Lennart Borgman
@ 2011-11-29 21:56 ` Drew Adams
2011-11-29 21:59 ` Lennart Borgman
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2011-11-29 21:56 UTC (permalink / raw)
To: 'Lennart Borgman'; +Cc: 'Chong Yidong', 10153
> > But my guess is that there will be many Emacs users who
> > will be confused by this, expecting TAB to indent
> > (if not to simply insert a TAB char). Not because
> > that's what TAB did in the past in Emacs, but because
> > that's more or less the behavior many newbies are used to,
> > from other text editors.
>
> Are not most users now used to web browsers (where TAB move to next
> field)
Irrelevant here - we're talking about editing.
> or programs like LibreOffice? In the latter TAB moves to next
> tab stop.
Yes, that is what they will expect. IIUC, that is different from the cited new
indentation when the region is active.
> Most users probably never use a simple text editor today.
> So I suggest TAB stop should indent.
I think the question is just what "indent" should mean in text mode, and whether
that meaning should change when the region is active.
(But again, personally, I don't much care.)
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-29 21:56 ` Drew Adams
@ 2011-11-29 21:59 ` Lennart Borgman
2011-11-29 22:18 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2011-11-29 21:59 UTC (permalink / raw)
To: Drew Adams; +Cc: Chong Yidong, 10153
On Tue, Nov 29, 2011 at 22:56, Drew Adams <drew.adams@oracle.com> wrote:
>> > But my guess is that there will be many Emacs users who
>> > will be confused by this, expecting TAB to indent
>> > (if not to simply insert a TAB char). Not because
>> > that's what TAB did in the past in Emacs, but because
>> > that's more or less the behavior many newbies are used to,
>> > from other text editors.
>>
>> Are not most users now used to web browsers (where TAB move to next
>> field)
>
> Irrelevant here - we're talking about editing.
You edit text fields in web pages so it is not totally irrelevant. TAB
does not insert a tab character there.
>> or programs like LibreOffice? In the latter TAB moves to next
>> tab stop.
>
> Yes, that is what they will expect. IIUC, that is different from the cited new
> indentation when the region is active.
I thought the new behavior indented to the line above. If that is not
the case I am misunderstanding. Sorry.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-29 21:59 ` Lennart Borgman
@ 2011-11-29 22:18 ` Drew Adams
2011-11-29 22:22 ` Lennart Borgman
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2011-11-29 22:18 UTC (permalink / raw)
To: 'Lennart Borgman'; +Cc: 'Chong Yidong', 10153
> >> or programs like LibreOffice? In the latter TAB moves to next
> >> tab stop.
> >
> > Yes, that is what they will expect. IIUC, that is different
> > from the cited new indentation when the region is active.
>
> I thought the new behavior indented to the line above. If that is not
> the case I am misunderstanding. Sorry.
That's my understanding also. That's not the same thing as moving to the next
tab stop, AFAIK. Anyway, I have nothing more to offer this thread, I'm afraid.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#10153: 24.0.91; behavior of TAB in text modes is different
2011-11-29 22:18 ` Drew Adams
@ 2011-11-29 22:22 ` Lennart Borgman
0 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman @ 2011-11-29 22:22 UTC (permalink / raw)
To: Drew Adams; +Cc: Chong Yidong, 10153
On Tue, Nov 29, 2011 at 23:18, Drew Adams <drew.adams@oracle.com> wrote:
>> >> or programs like LibreOffice? In the latter TAB moves to next
>> >> tab stop.
>> >
>> > Yes, that is what they will expect. IIUC, that is different
>> > from the cited new indentation when the region is active.
>>
>> I thought the new behavior indented to the line above. If that is not
>> the case I am misunderstanding. Sorry.
>
> That's my understanding also. That's not the same thing as moving to the next
> tab stop, AFAIK. Anyway, I have nothing more to offer this thread, I'm afraid.
To me it is close to move to the next tab stop. (And I have nothing
more to offer either ;-)
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-11-29 22:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28 8:13 bug#10153: 24.0.91; behavior of TAB in text modes is different Chong Yidong
2011-11-28 20:09 ` Glenn Morris
2011-11-29 15:17 ` Chong Yidong
2011-11-29 15:39 ` Drew Adams
2011-11-29 20:15 ` Lennart Borgman
2011-11-29 21:56 ` Drew Adams
2011-11-29 21:59 ` Lennart Borgman
2011-11-29 22:18 ` Drew Adams
2011-11-29 22:22 ` Lennart Borgman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).