Я использую emacs 22.2.1 и Ubuntu 9.04
Я сделал это в моем файле .emacs. Какие отступы и создает новую строку каждый раз, когда я нажимаю ';' или '{}'
if(success == 0)
{
printf("Success\n");
<---- if I press return key here it will go
<-- to here, and I have to tab to go to the code line.
Однако, если я нажму клавишу возврата, я попаду в столбец 0, а не в строку кода, над которой я работаю, т. Е.
(require 'cc-mode)
;; Auto indent on insertion of a curly brace
(add-hook 'c-mode-hook '(lambda()
(c-toggle-auto-state t)))
;; Set coding style to indent 4 spaces
(setq c-default-style "bsd"
c-basic-offset 4)