;; -*- emacs-lisp -*- ;; Set up the MINOS coding conventions macros. ;; This relies on `tempo.el' from http://www.lysator.liu.se/~davidk/elisp ;; It is likely already installed if you use newer GNU or X emacsen ;; Load the macro file. This needs to be in your load path or use ;; an explicit path. ;(load (expand-file-name "/explicit/path/to/minos-conventions.el")) (load "minos-conventions.el") (setq minos-convention-verbose nil) (setq minos-convention-expert t) ;; Tell what file extentions should trigger c++-mode (setq auto-mode-alist (append (mapcar 'purecopy '(("\\.h$" . c++-mode) ("\\.C$" . c++-mode) ("\\.c$" . c++-mode) ("\\.cc$" . c++-mode) ("\\.cpp$" . c++-mode) ("\\.cxx$" . c++-mode))) auto-mode-alist)) ;; Set up c++-mode. You can pick and choose from the ones in the ;; optional section and still be w/in conventions (defun my-c++-mode-common-hook () ;; Required: (minos-conventions) (c-set-style "cc-mode") (setq c-indent-level 4) (setq c-indent-comments-syntactically-p t) (setq indent-tabs-mode nil) ;; Optional: (local-set-key '(meta F) 'c-forward-into-nomenclature) (local-set-key '(meta B) 'c-backward-into-nomenclature) (local-set-key "\C-c\C-c" 'compile) ; (auto-fill-mode) (semantic-default-c-setup) ) (add-hook 'c++-mode-hook 'my-c++-mode-common-hook)