Angus Leeming <[EMAIL PROTECTED]> writes:

| Joao Luis Meloni Assirati wrote:
| > Is there some emacs mode that indents code only with tabs, as required by
| > lyx code rules? Do you recommend another editor?
| 
| Those brainwashed by vi propoganda will make some ridiculous suggestions to 
| this question. Ignore them.
| 
| Lars suggested I add this to my .emacs file and i find it works fine. The 
| bit you're looking for is the '(setq c-basic-offset 8)' line.
| 
| ;;; Common hook
| (defun my-c-mode-common-hook ()
| ;; Set return Style
| (local-set-key [return] 'newline-and-indent)
| (local-set-key [S-return] 'newline)
| (c-set-style "CC-MODE")
| )
| (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
| 
| ;; C++ mode hook
| (defun my-c++-mode-hook ()
| ;; Style parameters
| (setq c-basic-offset 8)
| (c-set-offset 'innamespace 0)
| (c-set-offset 'inextern-lang 0)
| (imenu-add-to-menubar "Index")
| (c-toggle-auto-state 0)
| )
| (add-hook 'c++-mode-hook 'my-c++-mode-hook)

I have a lot more fun stuff in my .emacs file now...

automatically breaking lines on { and always placeing } else { on the
same line etc. Plus a lot of whitespace washing.

 '(c++-mode-hook (quote (my-c++-mode-hook)))
 '(c-cleanup-list (quote (brace-else-brace brace-elseif-brace
 empty-defun-braces list-close-comma scope-operator)))

 '(c-hanging-braces-alist (quote ((defun-open before after)
 (defun-close before after) (class-open after) (class-close before)
 (inline-open after) (inline-close before after) (block-open after)
 (block-close before after) (substatement-open after)
 (statement-case-open) (extern-lang-open) (extern-lang-close)
 (brace-list-open) (brace-list-close) (brace-list-intro)
 (brace-entry-open) (inexpr-class-open) (inexpr-class-close))))
 '(c-hanging-colons-alist (quote ((case-label) (label after)
 (access-label after) (member-init-intro before) (inher-intro))))
 '(c-indent-comments-syntactically-p t)
 '(c-offsets-alist (quote ((inline-open . 0) (innamespace . 0))))
 '(c-strict-syntax-p t)

 '(c-tab-always-indent t)
 '(show-paren-mode t nil (paren))

+ the ones I had before...

-- 
        Lgb

Reply via email to