tab to spaces + indent questions

tab to spaces + indent questions

Post by Gali Diaman » Wed, 25 Feb 1998 04:00:00



I'm working on a project with several others, and since each uses their
favorite editor, we get terrible results when trying to read eachother's
code.

How can I save my document so that whitespaces are saved instead of tabs?
Can I define how many spaces are saved?
I know this can be done in vi, so emacs must have that option...

Secondly, how can I control the indent mode?
My current auto-indent will make my c code look like this:

for (...)
    {
        ...
    }

And what I'd like it to look like is:

for (...)
{
    ...

Quote:}

Any ideas?

Is there any source where answers to such questions can be found? The
tutorials/faqs I've seen didn't help much.

Please email me the answer(s) if possible.

Thanks,
Gali

------------------------------------------------------------------------

"I know she's in there," said Verence, holding his crown in his hands in
 the famous Ai-Senor-Mexican-Bandits-Have-Raided-Our-Village position.
                     -- (Terry Pratchett, Lords and Ladies)

 
 
 

tab to spaces + indent questions

Post by Kai Grossjohan » Wed, 25 Feb 1998 04:00:00


Quote:>>>>> On Tue, 24 Feb 1998, Gali Diamant said:

  Gali> I'm working on a project with several others, and since each
  Gali> uses their favorite editor, we get terrible results when
  Gali> trying to read eachother's code.

  Gali> How can I save my document so that whitespaces are saved
  Gali> instead of tabs?  Can I define how many spaces are saved?  I
  Gali> know this can be done in vi, so emacs must have that option...

Set indent-tabs-mode to nil to make Emacs use whitespace rather than
tab for the indentation.  You can convert existing files using M-x
untabify RET, or with the `expand' program.

You can set tab-width to change Emacs' assumption that a tab is eight
spaces wide.

  Gali> Secondly, how can I control the indent mode?
  Gali> My current auto-indent will make my c code look like this:
  Gali> [...]

Read the documentation on CC mode.  It explains how to change the
indentation for the current session, then goes on to explain how to
change it permanently.

  Gali> Is there any source where answers to such questions can be
  Gali> found? The tutorials/faqs I've seen didn't help much.

M-x apropos RET is your friend.  Type M-x apropos RET tab RET and you
will see the variable indent-tabs-mode, as well as the function
untabify, as well as the variable tab-width.

C-h i is also your friend.  It tells you all about CC mode, for
instance.

kai
--
A large number of young women don't trust men with beards.
(BFBS Radio)

 
 
 

1. indent with tab instead of spaces

hi newsgroup,

today my colleagues decided to use tabs instead of spaces to indent. i'm
the only one who uses xemacs and do not want to change.

so my question: how do i tell my xemacs [version 21.4; April 2001] to
use one tab-char instead of two spaces to indent in php-mode (i think
that this mode is a kind of c-mode)

thanks in advance,
--
mac

real email-adress: mac clondiag com

2. Closure of Acorn FTP site

3. Space insted of Tab indent

4. Copying Profiles manually

5. how to make emacs indent using tab instead of spaces

6. BAD COMPRESSION

7. Use tab instead of space in indent

8. UnauthorizedAccessException Help

9. Spaces to Tabs for Indenting?

10. tab to spaces + indent - continued

11. Beginners question - Tabs instead of spaces in C indentation?

12. Question: making emacs use spaces instead of tabs

13. Tabs to spaces and regular expression searching for tabs