|
Re: C formatting: msg#00879emacs.help
Oodini <svdbg@xxxxxxx> writes: > I ma desesperatly playing in my .emacs with the following statements, > but no luck: I suggest to try C-c C-o on the first line that has wrong indentation and to follow the prompts. Then hit TAB to reindent the line. When you like the indentation, you can use C-x ESC ESC and then M-p/M-n to retrieve the right c-set-offset statement. That's what you can put in the hook, below: > (setq c-mode-hook > (function > (lambda () > (setq c-basic-offset 0) > (setq c-indent-level 5) > (setq c-continued-statement-offset 5) > (setq c-argdecl-indent 0) > (setq c-brace-offset -5) > (setq c-label-offset -5) > ) > ) > ) This is not a good idea to do, either, as you are overriding old values for the hook. Never use setq on a hook. Always use add-hook instead. Here's my suggestion, fill in the missing c-set-offset statements here: (defun oodini-c-indent-setup () (setq c-basic-offset 5) (c-set-offset ...)) (add-hook 'c-mode-hook 'oodini-c-indent-setup) You didn't say which version of Emacs you are using. I'm assuming Emacs 21. Probably the above works for Emacs 20, too. -- Ambibibentists unite! |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Software/HD ecology: 00879, Kai Großjohann |
|---|---|
| Next by Date: | semigraphic characters: how to display?: 00879, Luca Ferrari |
| Previous by Thread: | Re: C formattingi: 00879, Kai Großjohann |
| Next by Thread: | Re: C formatting: 00879, Oodini |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |