Need help with either indent-tabs-mode and tab stop list

Need help with either indent-tabs-mode and tab stop list

Post by Christopher Bal » Mon, 19 Feb 2001 17:36:21



I set the tab stop list to be 2, 4, 6, 8, etc.
from the defaults (I think the default starts at 6
or so) and have indent-tabs-mode
set in my .emacs, but on M-x tabify, I still do
not get tab characters inserted in many places
where there are 2 or more
spaces starting a line.  Where there are 8 spaces,
I believe it does put tabs in; via C-x = I can see
that it does occasionally put
a tab in (but I think it's only when the lines
start out with either 6 or 8 spaces; can't
remember exactly).

Basically I need this to be compatible with others
using non-Emacs editors who are developing code
with me.  They need
tabs to be there whereever they can be.  By
setting the tab stop list to 2, 4, 6, 8, I thought
that I would be ensuring this.  Yet
Emacs only wants to insert a tab when there are a
lot more than two whitespaces starting a line.   I
am running GNU Emacs
20.6.1 and it is the Win2K port (yup: marooned on
NT).

What is the deal here?  Does anyone have any
ideas?

- Thanks in advance,
   Chris Balz (pronouced, "Baltz").

--

". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining bright
And within it opens into a World / . . .
Another England there I saw / Another London with its Tower
Another Thames & other Hills / And another pleasant Surrey Bower
. . ." - from The Crystal Cabinet, a poem by William Blake.

 
 
 

Need help with either indent-tabs-mode and tab stop list

Post by Kai Gro?joha » Mon, 19 Feb 2001 19:56:43



> I set the tab stop list to be 2, 4, 6, 8, etc.  from the defaults (I
> think the default starts at 6 or so) and have indent-tabs-mode set
> in my .emacs, but on M-x tabify, I still do not get tab characters
> inserted in many places where there are 2 or more spaces starting a
> line.

The variable tab-width also controls this.

Note that tab-stop-list controls the columns, indent-tabs-mode says
whether or not to use tab to move to the columns, and tab-width says
how far a tab character moves.

I have tried to explain this in my little `indentation' tutorial.
Does that help?

http://ls6-www.cs.uni-dortmund.de/~grossjoh/emacs/tutorials.html

kai
--
Be indiscrete.  Do it continuously.

 
 
 

Need help with either indent-tabs-mode and tab stop list

Post by Timothy M. Schaeffe » Wed, 21 Feb 2001 00:34:40


Did you (setq tab-width 2) ?

If you are editing C/C++ code, I have modifications to cc-mode which indents
code so that the tab sizes do not affect the indentation or alignment of
code -- it is smart about where code should be aligned or indented.

Tim S

Quote:

> I set the tab stop list to be 2, 4, 6, 8, etc.
> from the defaults (I think the default starts at 6
> or so) and have indent-tabs-mode
> set in my .emacs, but on M-x tabify, I still do
> not get tab characters inserted in many places
> where there are 2 or more
> spaces starting a line.  Where there are 8 spaces,
> I believe it does put tabs in; via C-x = I can see
> that it does occasionally put
> a tab in (but I think it's only when the lines
> start out with either 6 or 8 spaces; can't
> remember exactly).

> Basically I need this to be compatible with others
> using non-Emacs editors who are developing code
> with me.  They need
> tabs to be there whereever they can be.  By
> setting the tab stop list to 2, 4, 6, 8, I thought
> that I would be ensuring this.  Yet
> Emacs only wants to insert a tab when there are a
> lot more than two whitespaces starting a line.   I
> am running GNU Emacs
> 20.6.1 and it is the Win2K port (yup: marooned on
> NT).

> What is the deal here?  Does anyone have any
> ideas?

> - Thanks in advance,
>    Chris Balz (pronouced, "Baltz").

> --

> ". . . / This Cabinet is formd of Gold / And Pearl & Crystal shining
bright
> And within it opens into a World / . . .
> Another England there I saw / Another London with its Tower
> Another Thames & other Hills / And another pleasant Surrey Bower
> . . ." - from The Crystal Cabinet, a poem by William Blake.

 
 
 

1. Need help with tab-stop-list changing to tab-width's

I have a few questions about tabs in emacs

I am trying (and have...mostly) set up a tab-stop-list as shown

tab-stop-list's value is (8 14 27 37 47 57)

with   (setq tab-stop-list '(8 14 27 37 47 57))
and   (local-set-key "\t" 'tab-to-tab-stop)

with the intent of a user filling in a tab-aligned form

so a sample line would look like

start   stop  id1          description
1       2     abcd         efgh

when you enter it as 1(tab)2(tab)abcd(tab)efgh

but if you read this line into a c program(for parsing), or
move over it with the arrow keys(in emacs), I see
1(space)(tab)2(5 spaces)abcd(space)(tab)(3 spaces)efgh

when I add the line
1       2     abcd         efgh
1234567812345678123456781234567812345678

I note that the tabs are now lined up with the tab-width
variable, which is 8....

so how do I get my input to visually look like I want
and be actually just

1(tab)2(tab)abcd(tab)efgh

or can I?

So summary of what seems to be going on....

text input using tabs defined in the tab-stop-list is converted
into tabs and spaces based upon the tab-wdith variable.

I'd also like to know how to retabify an entire buffer
based upon a change in the tab-stop-list. Right now I suppose
that is being mucked up by the main problem I mentioned...

Thanks for any help,
Mike
--

Alcatel Network Sytems, Raleigh, NC           Minds are like parachutes....
My opinions, not Alcatel's                    they only function when open.
  Q:If one synchronized swimmer drowns, do the rest have to drown too?

2. FP2000 Extensions

3. TABS, TABS, TABS

4. To default to the same screen saver ...

5. Syntax to set "tab-stop-list"

6. on-line help systems

7. How can I stop Emacs using tabs altogether? (already have indent-tabs-mode nil)

8. FS: SparcStation ELC boards, SIMMs

9. Help c-mode tab indents how?

10. indent-tabs-mode obstructs filename completion?

11. indent-tabs-mode

12. Wanted: Help with edit-tab-stop, it's not working

13. Making Tab insert a tab in SQL-mode