View Full Version : configuring emacs

10-25-2001, 04:02 PM
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.

10-25-2001, 04:53 PM
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.

10-25-2001, 05:23 PM
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:


Thanks anyways Flarelocke.