Thread: configuring emacs

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    61

    configuring emacs

    Searching through the internet, I was able to find info. for setting my code-tyle for emacs. However, I was unable to figure out why my emacs setup doesn't automatically indent my code as i hit "enter". i.e. I type my code out and nothing is indented, but of course if i go down line by line hitting tab then everything is properly indented to my coding-style. So does anyone know how I might be able to configure emacs to indent as I hit "enter" and code? i.e. i type "int main() {" hit enter and cursor automatically positioned 4 spaces from the left margin (according to my coding-style).

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    79
    Try rebinding the enter key to whatever the command is to return & indent(can't remember right now what that is) Instructions can be found in the emacs manual.
    All generalizations are false

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    61
    cool, turns out i had to add this:

    (define-key c-mode-base-map "\C-m" 'newline-and-indent)

    along with my code style setting in the .emacs file.

    Here's the web page with the info. for anyone interested:

    http://sunsite.dk/fom/jde/cache/17.html

    Thanks anyways Flarelocke.

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. emacs
    By Troll_King in forum C Programming
    Replies: 13
    Last Post: 06-16-2002, 03:47 AM
  5. Telnet Emacs
    By gnu-ehacks in forum Linux Programming
    Replies: 8
    Last Post: 12-10-2001, 01:02 PM