Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Regarding C lang indenting in emacs

    Hi ,
    Iam new to linux forums. I am using emacs edior for coding c apps.
    For quite some time i've been having problems with the indenting feature.
    For eg ::

    int main()
      int i;
    All programs I write in 'C' have a default left indent of 2 spaces and and syntactically,
    the indent is also 2 spaces.(as you can see after the 'if')

    I want an indent of 8 spaces.
    So I customized .....certain variables in emacs...

    standard indent = 8
    tab always indent = t
    tab stop list = 0 8 16 ...
    c basic offset = 8
    c tab always indent = t
    c insert tab = t
    c syntactic indentation = t

    Still I dint get what i wanted. It would be great if
    some one using emacs..for ''c prg" can help me out in configuring
    my requirement


  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Täby, Sweden
    Emacs' C-mode has a small library of built-in indenting styles. Type C-c . (that's Control-C and then period) to choose one in the minibuffer. You can use tab completion to see which ones are available. I think you would want the one that is named "linux". Personally, I tend to use "stroustrup".

  3. #3
    Hi Dolda,
    Thanks for the information about builtin indentation styles in 'emacs'. It did help me a lot.
    And I went through some docs in all talks only about using emacs).

    Have you ever come accross any doc in the web, where one can find info about customizing/personalising emacs or builtin/pluggable facilities available ?


  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts