Thread: C++ in Emacs

  1. #1
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    C++ in Emacs

    i wonder anyone here use emacs ? i have some questions when coding with C++ file, for example how to customize indent size and highlight color ?
    Never end on learning~

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    'M-x font-lock-mode' should do the colouring for you. Not sure about the indent size. I use vim now, not emacs.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    edit your ".emacs" file (probably in your home directory) using the Lisp like emacs scripting language.

    - OR -

    click: Options -> Customize Emacs -> Top level Customization Group
    and customize through the GUI.

  4. #4
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563
    Quote Originally Posted by Perspective
    edit your ".emacs" file (probably in your home directory) using the Lisp like emacs scripting language.

    - OR -

    click: Options -> Customize Emacs -> Top level Customization Group
    and customize through the GUI.
    thanx i dive myself into Top level Customization and found standard indent size is 4 ? but actually when i coding a file default it seems indent is 8 spaces far. what's wrong ???
    Never end on learning~

  5. #5
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by black
    thanx i dive myself into Top level Customization and found standard indent size is 4 ? but actually when i coding a file default it seems indent is 8 spaces far. what's wrong ???
    hmmm, my standard indent size is 4 too, but may actual tab size when coding is 2.
    try adding this to your .emacs file, you can change the 4 to whatever tab size you want.
    Code:
    ;; set tab size to 4
       (defun my-c-mode-common-hook ()
         (setq c-basic-offset 4)
         )
       (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. emacs characters size and feel
    By hamsteroid in forum Tech Board
    Replies: 10
    Last Post: 03-29-2007, 01:51 PM
  2. Emacs frames
    By frenchfry164 in forum Tech Board
    Replies: 2
    Last Post: 12-28-2003, 02:04 PM
  3. copying and pasting from emacs
    By curlious in forum Linux Programming
    Replies: 1
    Last Post: 12-13-2003, 10:08 PM
  4. Telnet Emacs
    By gnu-ehacks in forum Linux Programming
    Replies: 8
    Last Post: 12-10-2001, 01:02 PM
  5. configuring emacs
    By greenRoom in forum Linux Programming
    Replies: 2
    Last Post: 10-25-2001, 05:23 PM